|
static void | oam_deploy_main () |
|
static void | oam_deploy_sub () |
|
◆ add_frame()
int DSC::Sprite::add_frame |
( |
ObjFrame * |
frame | ) |
|
Adds a new sprite frame.
- Parameters
-
frame | Object Frame specifying the spritesheet and frame coordinates |
- Returns
- frame id to be used when setting the frame for display, also when including the frame into animated framesets
◆ flip_horizontal()
void DSC::Sprite::flip_horizontal |
( |
| ) |
|
Flips the sprite horizontally
◆ flip_vertical()
void DSC::Sprite::flip_vertical |
( |
| ) |
|
Flips the sprite vertically
◆ get_engine()
Engine DSC::Sprite::get_engine |
( |
| ) |
const |
Gets sprite owner engine (Main/Sub)
◆ get_size()
Size< char > DSC::Sprite::get_size |
( |
| ) |
const |
gets the sprite size
- Returns
- width and height of sprite, in pixels
◆ get_visual()
ObjVisual * DSC::Sprite::get_visual |
( |
| ) |
const |
gets the sprite visual information
- Returns
- pointer to sprite's visual data
◆ hide()
void DSC::Sprite::hide |
( |
| ) |
|
◆ is_flipped_horizontal()
bool DSC::Sprite::is_flipped_horizontal |
( |
| ) |
const |
Checks if the sprite is flipped horizontally
◆ is_flipped_vertical()
bool DSC::Sprite::is_flipped_vertical |
( |
| ) |
const |
Checks if the sprite is flipped vertically
◆ is_hidden()
bool DSC::Sprite::is_hidden |
( |
| ) |
const |
Checks if the sprite is hidden
◆ move()
void DSC::Sprite::move |
( |
sf24 |
x, |
|
|
sf24 |
y |
|
) |
| |
moves a sprite relative to its virtual position
- Parameters
-
x | relative horizontal position |
y | relative vertical position |
◆ set_anchor()
void DSC::Sprite::set_anchor |
( |
int |
anchor_x, |
|
|
int |
anchor_y |
|
) |
| |
Sets sprite anchor relative to hitbox.
- Parameters
-
anchor_x | horizontal anchor (0..255) 0=left-most, 255=right-most, 128=center |
anchor_y | vertical anchor (0..255) 0=top-most, 255=bottom-most, 128=center |
◆ set_flip_horizontal()
void DSC::Sprite::set_flip_horizontal |
( |
bool |
is_flipped | ) |
|
Sets the sprite is horizontal flip state.
- Parameters
-
is_flipped | true if sprite must be flipped, false otherwise |
◆ set_flip_vertical()
void DSC::Sprite::set_flip_vertical |
( |
bool |
is_flipped | ) |
|
Sets the sprite is vertical flip state.
- Parameters
-
is_flipped | true if sprite must be flipped, false otherwise |
◆ set_position()
void DSC::Sprite::set_position |
( |
sf24 |
x, |
|
|
sf24 |
y |
|
) |
| |
sets the sprite virtual position
- Parameters
-
x | horizontal position |
y | vertical position |
The sprite position is actually the logical position and may coincide or not with the real (hardware) position. When interacting with a Camera, the sprite's hardware position is computed from the logical position relative to the camera offset. If the sprite is not in relation with any Camera, then the hardware position is calculated from the logical position relative to the top-left of the screen, when taking into account other details like the anchor and hitbox.
◆ set_priority()
void DSC::Sprite::set_priority |
( |
int |
priority | ) |
|
Sets sprite priority.
- Parameters
-
- Warning
- Use this only if you know what you are doing. Messing up with priorities can make sprites display behind backgrounds, in which case it is a potentially hard to detect bug source in larger contexts.
◆ show()
void DSC::Sprite::show |
( |
| ) |
|
◆ update_position()
void DSC::Sprite::update_position |
( |
| ) |
|
Renders position data to sprite's OAM attribute
◆ update_visual()
void DSC::Sprite::update_visual |
( |
| ) |
|
Renders visual data to sprite's OAM attribute
◆ x()
virtual sf24 DSC::Sprite::x |
( |
| ) |
const |
|
overridevirtual |
Gets sprite horizontal position in the virtual space
Implements DSC::Localizable.
◆ y()
virtual sf24 DSC::Sprite::y |
( |
| ) |
const |
|
overridevirtual |
The documentation for this class was generated from the following file: