Skip to content
Kirby0Louise edited this page Mar 17, 2021 · 6 revisions

A Sprite is one of the two types of images Void2D can draw. Sprites are intended to be used for dynamic objects in the game world, such as the player, enemies, bullets, power ups, etc...

All sprites are composed of tiles from TVRAM. The tile makeup of a sprite can be changed at any time, allowing for smooth animation.

Fields

Method Name Data Type Details
priority int64_t Signed 64-bit integer used to determine when to draw the sprite
rotation float Rotation of the sprite in degrees. Must be between 0.0 and 359.9999...., any other values will either be corrected (V2D High Level) or throw an exception (V2D Low Level)
scale float Scaling factor of the sprite. A value of 1.0 gives a 1:1 scale. Must be greater than zero
namet Nametable Pointer to a structure containing the Nametable for the Sprite
visible bool Indicates whether or not to draw the Sprite

Methods

Method Name Return Type Arguments Details
getNametable Nametable No arguments Returns the Nametable structure for the Sprite
getPriority int64_t No arguments Returns the current value of the Sprite's priority
getRotation float No arguments Returns the current value of the Sprite's rotation
getScale float No arguments Returns the current value of the Sprite's scale
isVisible bool No arguments Returns whether or not the Sprite is visible
setNametable void Nametable newNT Sets the Sprite's Nametable
setPriority void int64_t newPriority Sets the Sprite's priority value
setRotation void float newRotation Sets the Sprite's rotation value
setScale void float newScale Sets the Sprite's scale value
setVisible void bool newVisible Sets the Sprite's visibility
Clone this wiki locally