Skip to content
CShift0.32

Sprite

Struct · namespace Amiga · AmigaOS only · Since 0.20

struct Sprite

A hardware sprite: 16 pixels wide, as high as needed, three colors (sprites 0 and 1 use the colors 17-19, 2 and 3 21-23, 4 and 5 25-27, 6 and 7 29-31). Screen.ShowSprite shows it.

Name Description
Height The height of the sprite in pixels.
int Height

The height of the sprite in pixels.

Name Description
Create One string per row (up to 16 characters): ‘1’..‘3’ are the sprite’s colors, every other character (‘.’, ’ ’) is transparent.
static Optional<Sprite> Create(ReadOnlySlice<StringSlice> rows)

One string per row (up to 16 characters): ‘1’..‘3’ are the sprite’s colors, every other character (‘.’, ’ ’) is transparent. Null if there is not enough chip memory.

static Optional<Sprite> Create(ReadOnlySlice<string> rows)

The same with the rows as strings, e.g. the lines of a file: const ReadOnlySlice<string> Ship = embed_lines("ship.txt"); … Sprite.Create(Ship).

Name Description
MoveTo Moves the top left corner of the sprite to (x, y) of the picture.
Address The address of the sprite’s data in chip memory.
Free Gives the chip memory back.
void MoveTo(int x, int y)

Moves the top left corner of the sprite to (x, y) of the picture.

void* Address()

The address of the sprite’s data in chip memory.

void Free()

Gives the chip memory back.