About Resources

Resources used by SwinGame to show Animation, Fonts, Images, Maps, Panels and Sounds are stored in sub-folders of the Resources folder.





SwinGame is organised so that there is a separation between kinds of files. For example, all image files must be put into the 'Resources/images' folder while all sounds and music must be put into the 'Resources/sounds'. This is required because when you try to load an image using 'LoadBitmap' or 'LoadBitmapNamed' it looks in the 'Resources/images' directory for the filename.

Most resource kinds can be loaded in code using the functions Load____, or Load____Named. These functions search the appropriate folder in Resources and load the resource into memory so that you can use it in your code.

Once you're done with a resource it is a good idea to free the resource from memory to avoid filling the memory with resources your not using any more. This can be done with the Free____ procedure.

    1. myImage = LoadBitmapNamed(my_image.jpg, 'image') 
    2. call DrawBitmap(myImage) 
    3. call FreeBitmap(myImage)