16#define CARD_SPRITE_SIZE_PX 32
18#define MAX_SPRITES 128
19#define MAX_SPRITE_OBJECTS 16
20#define SPRITE_FOCUS_RAISE_PX 10
21#define CARD_FOCUS_SFX_PITCH_OFFSET_RANGE 512
29#define CARD_SPRITE_TILES 16
30#define JOKER_SPRITE_TILES 16
31#define BLIND_SPRITE_TILES 16
32#define SKIP_TAG_SPRITE_TILES 4
471 obj_set_pos(sprite->
obj, x, y);
485 sprite_object->
x = int2fx(x);
486 sprite_object->y = int2fx(y);
487 sprite_object->
tx = int2fx(x);
488 sprite_object->ty = int2fx(y);
bool sprite_object_get_dimensions(SpriteObject *sprite_object, int *width, int *height)
Get the width and height of SpriteObject's registered Sprite.
bool sprite_object_is_focused(SpriteObject *sprite_object)
Get the focused variable from a SpriteObject.
bool sprite_get_width(Sprite *sprite, int *width)
Get a Sprite's width.
INLINE void sprite_position(Sprite *sprite, int x, int y)
Set sprite position. Inlined for efficiency.
void sprite_object_unhide(SpriteObject *sprite_object)
Unhides the SpriteObject by manipulating ATTR0_HIDE in OAM. The sprite's ATTR0_MODE is maintained fro...
void sprite_object_set_focus(SpriteObject *sprite_object, bool focus)
Set the focus for SpriteObject Raises the object by SPRITE_FOCUS_RAISE_PX.
void sprite_object_init(SpriteObject *sprite_object)
Initialize a SpriteObject to a default state. Must be called only once per SpriteObject when it is cr...
void sprite_object_destroy(SpriteObject *sprite_object)
Destroy SpriteObject.
void sprite_object_print_price_under(SpriteObject *sprite_object, int price)
Print the price string directly beneath a SpriteObject. More specialized version of sprite_object_pri...
s16 sprite_get_layer(Sprite *sprite)
Get index of Sprite in the GBA object buffer.
void sprite_object_print_text_under(SpriteObject *sprite_object, const char text[])
Print the given string directly beneath a SpriteObject. This is used only for Cards for now.
int sprite_get_tid(enum SpriteType sprite_type, s16 layer)
Get the tile index of a certain SpriteType at a certain layer.
void sprite_init(void)
Initialize GBAlatro sprite system.
void sprite_object_bounce(SpriteObject *sprite_object, FIXED strength)
Make SpriteObject bounce by slightly increasing its size in an elastic way.
void sprite_object_reset_transform(SpriteObject *sprite_object)
Reset SpriteObject's transform back to default values.
int sprite_get_pb(const Sprite *sprite)
Get the palette bank of a Sprite.
bool sprite_object_get_width(SpriteObject *sprite_object, int *width)
Get a SpriteObject's width.
void sprite_object_set_sprite(SpriteObject *sprite_object, Sprite *sprite)
Register a Sprite to an associated SpriteObject.
void sprite_object_update_all(void)
Update all SpriteObjects, to be called once per frame in the main update loop.
void sprite_object_set_target(SpriteObject *sprite_object, BG_POINT to)
Set a SpriteObject's target position so that is slides across the screen between from the current pos...
bool sprite_get_dimensions(Sprite *sprite, int *width, int *height)
Get a Sprite's width and height.
bool sprite_object_get_height(SpriteObject *sprite_object, int *height)
Get a SpriteObject's height.
INLINE void sprite_object_position(SpriteObject *sprite_object, int x, int y)
Set sprite_object position. Inlined for efficiency.
void sprite_object_shake(SpriteObject *sprite_object, mm_word sound_id)
Shake SpriteObject on screen and play a sound.
Sprite * sprite_new(u16 a0, u16 a1, u32 tid, u32 pb, s16 sprite_index)
Allocate and retrieve a pointer to a valid Sprite.
void sprite_object_erase_text_under(SpriteObject *sprite_object)
Erase the text within the Rect directly beneath a SpriteObject. This is used only for Cards for now.
bool sprite_get_height(Sprite *sprite, int *height)
Get a Sprites's height.
void sprite_destroy(Sprite **sprite)
Destroy Sprite.
Sprite * sprite_object_get_sprite(SpriteObject *sprite_object)
Get a SpriteObject's registered Sprite.
SpriteType
The different types of sprites in the game.
void sprite_hide(Sprite *sprite)
Hides the sprite by manipulating ATTR0_HIDE in OAM.
void sprite_unhide(Sprite *sprite)
Unhides the sprite by manipulating ATTR0_HIDE in OAM. The sprite's ATTR0_MODE is maintained from the ...
int sprite_get_starting_layer(enum SpriteType sprite_type)
Get the starting layer of a certain type of sprite.
void sprite_object_sway(SpriteObject *sprite_object)
Make SpriteObject sway by slightly rotating on screen.
void sprite_draw(void)
Draw Sprites to screen, to be called once per frame.
IWRAM_CODE void sprite_object_update(SpriteObject *sprite_object)
Update a SpriteObject, to be called once per frame per active SpriteObject.
void sprite_object_hide(SpriteObject *sprite_object)
Hides the SpriteObject by manipulating ATTR0_HIDE in OAM.
A sprite object is a sprite that is focusable and movable in animation.
bool focused
Focused status (card specific, raise and lower card)
FIXED vscale
Scale velocity AKA the rate of change of scaling ops.
FIXED rotation
Actual rotation, in units for tonc's obj_aff_rotscale
FIXED trotation
Target rotation.
FIXED scale
Current Scale, in units for tonc's obj_aff_rotscale
Sprite * sprite
Sprite configuration info.
FIXED tscale
Target Scale.
FIXED vrotation
Rotation velocity.
Sprite struct for GBA hardware specifics.
POINT pos
Sprite position on screen in pixels.
OBJ_AFFINE * aff
GBA sprite affine matrices registers info.
s16 idx
Sprite index in memory managed by GBAlatro.
u16 mode
The mode of the sprite (regular, affine, etc.), set when the sprite is created corresponds to A0 & AT...
OBJ_ATTR * obj
GBA sprite attribute registers info (A0-A2)