Sprite

OpenTuring

Sprite

Description   Sprites are a way of doing animation in Turing bypassing the Pic module. A sprite is essentially a picture with a specific location and "depth". You create a sprite by calling Sprite.New with a picID received from Pic.New. You can then move the sprite around by calling Sprite.SetPosition. When you are finished with the sprite, you call Sprite.Free.

Note that sprites work best when they are moderately small. If you have large sprites, you will continue to have flashing.

All subprograms in the Sprite unit are exported qualified (and thus must be prefaced with "Sprite.").

Entry Points  
New Creates a new sprite from a picture.
Free Disposes of a sprite and free up its memory.
SetHeight Sets the height of a sprite. Sprites with a greater height appear above sprites with a lesser height. The background is considered height 0. The height may be negative.
SetPosition Sets the location of the sprite. Can specify the center of the sprite or the lower-left corner.
SetFrameRate Sets the maximum number of times a second the sprites will be moved on screen.
ChangePic Changes the picture associated with a sprite.
Animate Changes the location and the picture associated with a sprite. Used for animating a moving changing image.
Show Shows a previously hidden sprite.
Hide Hides a visible sprite.