Sprite Array Specification - nonkit/Anime GitHub Wiki

Documentation > Sprite Array Specification

Sprite Array Specification

Version 0.6.1 Nonki Takahashi

Purpose

This specification is to define the sprite array for shapes in Microsoft Small Basic programming language. The shape array is already used in such Shapes editor. The purpose of the sprite array is grouping shapes in the sprite array.

Definitions

In this specification, data format and subroutines for the sprite array are defined.

Data Format

The Array

The name of the array is sprite.

Properties (indices)

  • name - the sprite name.
  • x - x coordinate of the sprite position.
  • y - y coordinate of the sprite position.
  • width - width of the sprite position.
  • height - height of the sprite position.
  • scaleX - scaleX to zoom the sprite.
  • scaleY - scaleY to zoom the sprite.
  • angle - angle to rotate the sprite.
  • cx - x coordinate of the rotate center of the sprite.
  • cy - y coordinate of the rotate center of the sprite.
  • shape - shape array.
  • n - number of shapes.

Subroutines

  • Sprite_Add - add shapes as a sprite
  • Sprite_Flip - flip the sprite around the y axis
  • Sprite_GetIndexOf - get the index of the sprite
  • Sprite_GetPos - get the position of the sprite
  • Sprite_Hide - hide the sprite
  • Sprite_Init - initialize for sprite array
  • Sprite_Move - move the sprite
  • Sprite_Remove - remove the sprite
  • Sprite_Rotate - rotate the sprite around the z axis (from center or given point)
  • Sprite_Show - show the sprite
  • Sprite_Zoom - zoom the sprite

Known Issues

  1. Text can't be flipped correctly.
  2. x, y, width, height properties are not accurate if there are rotated shapes.

See Also