cmdfx 0.1.0
Lightweight game engine for your terminal
Loading...
Searching...
No Matches
sprites.h File Reference

Animation Extensions for sprites.h. More...

#include "cmdfx/sprites.h"

Go to the source code of this file.

Functions

void Sprite_moveTo_anim (CmdFX_Sprite *sprite, int x, int y, double time)
 Moves a sprite to the given position with an animation.
 
void Sprite_moveBy_anim (CmdFX_Sprite *sprite, int dx, int dy, double time)
 Moves a sprite by the given amount with an animation.
 

Detailed Description

Animation Extensions for sprites.h.

Author
Gregory Mitchell (me@gm.nosp@m.itch.nosp@m.215.x.nosp@m.yz)
Version
0.1.0
Date
2025-01-24

Function Documentation

◆ Sprite_moveBy_anim()

void Sprite_moveBy_anim ( CmdFX_Sprite * sprite,
int dx,
int dy,
double time )

Moves a sprite by the given amount with an animation.

This method moves a sprite by the given amount with an animation. The sprite will move by the given amount over the specified time. The time is in seconds, and the sprite will move at a constant speed. The sprite will be redrawn at each position during the animation.

Parameters
spriteThe sprite to move.
dxThe delta X position to move the sprite by.
dyThe delta Y position to move the sprite by.
timeThe time, in seconds, for the animation.

◆ Sprite_moveTo_anim()

void Sprite_moveTo_anim ( CmdFX_Sprite * sprite,
int x,
int y,
double time )

Moves a sprite to the given position with an animation.

This method moves a sprite to the given position with an animation. The sprite will move from its current position to the given position over the specified time. The time is in seconds, and the sprite will move at a constant speed. The sprite will be redrawn at each position during the animation.

Parameters
spriteThe sprite to move.
xThe new X position of the sprite.
yThe new Y position of the sprite.
timeThe time, in seconds, for the animation.