Resource Bundles
Functions
Free Resource Bundle
When you are finished with the resources in a bundle, you can free them all by calling this procedure. It will free the resource bundle and all of the associated resources.
Parameters
Name | Type | Description |
---|---|---|
name | String | The name of the resource bundle to be freed |
Signatures
Has Resource Bundle
Returns true when the named resource bundle has already been loaded.
Parameters
Name | Type | Description |
---|---|---|
name | String | The name of the resource bundle. |
Return Type - Boolean
Signatures
Load Resource Bundle
Loads all of the resources in the resource bundle. The resource bundle is a
text file that describes the resources you want to load. These rescources
are then loaded when you call this procedure, and can all be released when
you call release_resource_bundle
.
Save the resource bundle text files into your projects Resources
in the
bundles
folder. Use the following as the format for each of the
resources.
Start a line with a //
to have it ignored when the bundle is loaded. This
can be used to add comments to your bundle.
- To load an animation use the format:
For example, the following will load an animation named âWalkingScriptâ that
loads the animation from âkermit.txtâ in your games animation Resources
.
- To load a bitmap use the format:
For example, the following will load a bitmap named âLogoâ using the âLogo.pngâ file.
- To load a bitmap that has a number of cells, you can extend the bitmap format with the cell details. This has the format:
The following will setup the âPlayerâ bitmap to have cells that are 75 pixels wide, and 42 pixels height. There are 4 columns in 1 row, giving a total of 4 cells.
- To load a font use FONT,name,filename. For example, the following loads a font named âGameFontâ that represents the âdemolition.otfâ.
- To load music, use MUSIC,name,filename. The following loads âGameMusicâ for the âmagical_night.oggâ file.
- To load a sound effect, use SOUND,name,filename. For example the following loads âerrorâ from the âerror.wavâ file.
- To create a timer use TIMER,name. The following creates a timer named as âmy timerâ.
- You can also load another resource bundle using BUNDLE,name,filename. The following loads âanother bundleâ from the âanother.txtâ file.
Parameters
Name | Type | Description |
---|---|---|
name | String | The name of the bundle when it is loaded. |
filename | String | The filename to load. |
Signatures