LoadSprite

Description

Creates a sprite in a blank sprite ID with an explicit image to use when rendering, it returns the sprite ID used.

By default sprites are created with a depth of 10, are sized using the given image as a guide, and positioned at 0,0 using their top left corner.

If the assigned image has alpha pixels the sprite is create with a transparency mode of 1, otherwise it uses a transparency mode of 0 (opaque) This command takes an image file name and loads it specifically for this sprite, this image will be deleted when the sprite is deleted. If lots of sprites are going to use the same image you should load the image separately and pass its ID to the CreateSprite command to save memory.

Definition

integer LoadSprite( imagefile )

LoadSprite( iSpriteIndex, imagefile )

Parameters