SpriteMaster Pro

Type structure - smSprite


SpriteMaster Pro uses types to maintain the sprites created, loaded, and extracted (from packs).
The table below shows the structures field names and their role in SpriteMaster Pro.

The name of the type is .smSprite

The commands/functions rely on the type structure:

pack1=LoadPack("brick.png")
ball.smSprite=GetPackedSprite("bigball",pack1)
DebugLog ball\width ; returns width of ball sprite

If you modify any of the fields you should use the appropriate command to update the sprite:

pack1=LoadPack("brick.png")
ball.smSprite=GetPackedSprite("bigball",pack1)
ball\angle=ball\angle+64
RotateSprite ball,ball\angle

There are 10 spare floats in the type structure which you may want to take advantage of. These are labelled var#[0] to var#[9]
Every sprite has it's own set of 10 spare variables.

Note: There are other variables in the structure. These should not be modified.
See the smPro.bb include for more information.


.smSprite

Parameter Info Update with
name$ sprites name n/a
x# x position on screen (in pixels) PostionSprite
y# y position on screen (in pixels) PostionSprite
width width (in pixels) ResizeSprite
height height (in pixels) ResizeSprite
handleX handle/axis offset (X) HandleSprite
handleY handle/axis offset (Y) HandleSprite
angle# sprites rotated angle RotateSprite
flippedX TRUE if sprite is flipped horizontally FlipSprite
flippedY TRUE if sprite is flipped vertically FlipSprite
frame current frame in use (animation) PostionSprite
numframes total of animation frames in sprite n/a
red Red component color (0 to 255) SpriteColor
green Green component color (0 to 255) SpriteColor
blue Blue component color (0 to 255) SpriteColor
alpha# alpha value (0.0 to 1.0) SpriteAlpha
var#[9] spare variables for your own use n/a

Main Page