Sprite
Struct · namespace Amiga · AmigaOS only · Since 0.20
struct SpriteA 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.
Fields
Section titled “Fields”| Name | Description |
|---|---|
Height |
The height of the sprite in pixels. |
Height
Section titled “Height”int HeightThe height of the sprite in pixels.
Static methods
Section titled “Static methods”| Name | Description |
|---|---|
Create |
One string per row (up to 16 characters): ‘1’..‘3’ are the sprite’s colors, every other character (‘.’, ’ ’) is transparent. |
Create
Section titled “Create”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).
Methods
Section titled “Methods”| 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. |
MoveTo
Section titled “MoveTo”void MoveTo(int x, int y)Moves the top left corner of the sprite to (x, y) of the picture.
Address
Section titled “Address”void* Address()The address of the sprite’s data in chip memory.
void Free()Gives the chip memory back.