Rss

Loading Assets

Each asset type, Textures, Geometry etc.. has it’s own static functions for loading assets, each with custom properties, but they all have the one property in common, AssetName.

AssetName is essentially, the filename of the asset to load, but the file can be embedded, a local file or a URL.

Below is an example of how to specify the different ways, using a Texture asset.

To load a texture from a local file:

Texture lensflare = Texture.Load(Mipmapping.Nearest, false,
                              "planets/sunflare.ibc");

To load a texture from a URL:

Texture lensflare = Texture.Load(Mipmapping.Nearest, false,
         "http://www.mywebsite.com.sg/planets/sunflare.ibc");

NOTE: The web server will need to be configured to allow downloading of the requisite file extensions, in this case, .ibc.

To load the texture from an embedded resource:

Texture lensflare = Texture.Load(Mipmapping.Nearest, false,
                                    "embed://sunflare.ibc");

NOTE: The web server will need to be configured to allow downloading of the requisite file extensions, in this case, .ibc.

Like This Post? Share It

Previous Post

Next Post

Leave a Reply

Your email address will not be published. Required fields are marked *