Sprite.New

OpenTuring

Sprite.NewPart of Sprite module

Syntax   Sprite.New (picID : int) : int

Description   Creates a new sprite from a picture specified by picID. The sprite starts invisible and should be given a depth using Sprite.SetHeight and a position, given Sprite.SetPosition before being made visible using Sprite.Show. When you are finished using the sprite, the sprite should be freed using Sprite.Free.

Sprites work best when they are of moderate size. Large sprites will cause flashing when moved across the screen.

Anything that is is color 0 in the picture will not appear when the sprite is drawn. In other words, color 0 is transparent. (This is by default. You can set the transparent color for a sprite by setting the picture's transparent colour using Pic.SetTransparentColor.

Example   See Sprite.Animate for an example of Sprite.New.

Status   Exported qualified.

This means that you can only call the function by calling Sprite.New, not by calling New.

See also   Sprite.SetHeight, Sprite.SetPosition, Sprite.Show and Sprite.Free.