Home
Free Midlets
Help

GELLOAD

Syntax: GELLOAD gelName, resourceName

The GELLOAD command creates the named Graphics Elements (GEL) and loads it with data loaded from the MIDlet's JAR file. For maximum portability the data in the JAR file should be stored in PNG format but you will also find that GIF and JPG files are also widely supported.

GEL Images are associated with a SPRITE using the SPRITEGEL command. The sprite may then be moved around the screen using SPRITEMOVE command.

To add a PNG, GIF or JPG image in the Desktop Environment you need to select the "Resources" menu item. Navigate to the files you wish to add and click the "Add Resource" button.

The IMPORTANT part: The GELLOAD command takes two strings, the internal name of the GEL within your program and the name of the resource. The resource name will always be the same as the original filename less the path information.

So if you add "c:\Images\MyImage.gif" to the resource list you can load it into Mobile BASIC with the following command:-

GELLOAD "GelName","MyImage.gif"

To draw it on the screen use:-

GELDRAW "GelName",xpos,ypos

To assign it to a Sprite use:-

SPRITEGEL "SpriteName", "GelName"

And to move the Sprite use:-

SPRITEMOVE "SpriteName",xpos%,ypos%

This command is of little use if you are only writing Mobile BASIC programs on the handset since you have no way of getting your resource files into the MIDlet's JAR file. The command is usually used by Mobile BASIC programs that have been written using the Desktop Environment.

Note: Prior to Mobile BASIC 1.6, GELLOAD had the same functionality and syntax as GELGRAB.

Example

GELLOAD "gelName", "resouceName"