citro2d
Functions
Sprite functions

Functions

static void C2D_SpriteFromImage (C2D_Sprite *sprite, C2D_Image image)
 Initializes a sprite from an image. More...
 
static void C2D_SpriteFromSheet (C2D_Sprite *sprite, C2D_SpriteSheet sheet, size_t index)
 Initializes a sprite from an image stored in a sprite sheet. More...
 
static void C2D_SpriteScale (C2D_Sprite *sprite, float x, float y)
 Scale sprite (relative) More...
 
static void C2D_SpriteRotate (C2D_Sprite *sprite, float radians)
 Rotate sprite (relative) More...
 
static void C2D_SpriteRotateDegrees (C2D_Sprite *sprite, float degrees)
 Rotate sprite (relative) More...
 
static void C2D_SpriteMove (C2D_Sprite *sprite, float x, float y)
 Move sprite (relative) More...
 
static void C2D_SpriteSetScale (C2D_Sprite *sprite, float x, float y)
 Scale sprite (absolute) More...
 
static void C2D_SpriteSetRotation (C2D_Sprite *sprite, float radians)
 Rotate sprite (absolute) More...
 
static void C2D_SpriteSetRotationDegrees (C2D_Sprite *sprite, float degrees)
 Rotate sprite (absolute) More...
 
static void C2D_SpriteSetCenter (C2D_Sprite *sprite, float x, float y)
 Set the center of a sprite in values independent of the sprite size (absolute) More...
 
static void C2D_SpriteSetCenterRaw (C2D_Sprite *sprite, float x, float y)
 Set the center of a sprite in terms of pixels (absolute) More...
 
static void C2D_SpriteSetPos (C2D_Sprite *sprite, float x, float y)
 Move sprite (absolute) More...
 
static void C2D_SpriteSetDepth (C2D_Sprite *sprite, float depth)
 Sets the depth level of a sprite (absolute) More...
 
static bool C2D_DrawSprite (const C2D_Sprite *sprite)
 Draw sprite. More...
 
static bool C2D_DrawSpriteTinted (const C2D_Sprite *sprite, const C2D_ImageTint *tint)
 Draw sprite with color tinting. More...
 

Detailed Description

Function Documentation

static bool C2D_DrawSprite ( const C2D_Sprite sprite)
inlinestatic

Draw sprite.

Parameters
[in]spriteSprite to draw
static bool C2D_DrawSpriteTinted ( const C2D_Sprite sprite,
const C2D_ImageTint tint 
)
inlinestatic

Draw sprite with color tinting.

Parameters
[in]spriteSprite to draw
[in]tintColor tinting parameters to apply to the sprite
static void C2D_SpriteFromImage ( C2D_Sprite sprite,
C2D_Image  image 
)
inlinestatic

Initializes a sprite from an image.

Parameters
[in]Pointerto sprite
[in]imageImage to use
static void C2D_SpriteFromSheet ( C2D_Sprite sprite,
C2D_SpriteSheet  sheet,
size_t  index 
)
inlinestatic

Initializes a sprite from an image stored in a sprite sheet.

Parameters
[in]Pointerto sprite
[in]sheetSprite sheet handle
[in]indexIndex of the image inside the sprite sheet
static void C2D_SpriteMove ( C2D_Sprite sprite,
float  x,
float  y 
)
inlinestatic

Move sprite (relative)

Parameters
[in]spritePointer to sprite
[in]xX translation
[in]yY translation
static void C2D_SpriteRotate ( C2D_Sprite sprite,
float  radians 
)
inlinestatic

Rotate sprite (relative)

Parameters
[in]spritePointer to sprite
[in]radiansAmount to rotate in radians
static void C2D_SpriteRotateDegrees ( C2D_Sprite sprite,
float  degrees 
)
inlinestatic

Rotate sprite (relative)

Parameters
[in]spritePointer to sprite
[in]degreesAmount to rotate in degrees
static void C2D_SpriteScale ( C2D_Sprite sprite,
float  x,
float  y 
)
inlinestatic

Scale sprite (relative)

Parameters
[in]spritePointer to sprite
[in]xX scale (negative values flip the sprite horizontally)
[in]yY scale (negative values flip the sprite vertically)
static void C2D_SpriteSetCenter ( C2D_Sprite sprite,
float  x,
float  y 
)
inlinestatic

Set the center of a sprite in values independent of the sprite size (absolute)

Parameters
[in]spritePointer to sprite
[in]xX position of the center (0.0 through 1.0)
[in]yY position of the center (0.0 through 1.0)
static void C2D_SpriteSetCenterRaw ( C2D_Sprite sprite,
float  x,
float  y 
)
inlinestatic

Set the center of a sprite in terms of pixels (absolute)

Parameters
[in]spritePointer to sprite
[in]xX position of the center (in pixels)
[in]yY position of the center (in pixels)
static void C2D_SpriteSetDepth ( C2D_Sprite sprite,
float  depth 
)
inlinestatic

Sets the depth level of a sprite (absolute)

Parameters
[in]spritePointer to sprite
[in]depthDepth value
static void C2D_SpriteSetPos ( C2D_Sprite sprite,
float  x,
float  y 
)
inlinestatic

Move sprite (absolute)

Parameters
[in]spritePointer to sprite
[in]xX position
[in]yY position
static void C2D_SpriteSetRotation ( C2D_Sprite sprite,
float  radians 
)
inlinestatic

Rotate sprite (absolute)

Parameters
[in]spritePointer to sprite
[in]radiansAmount to rotate in radians
static void C2D_SpriteSetRotationDegrees ( C2D_Sprite sprite,
float  degrees 
)
inlinestatic

Rotate sprite (absolute)

Parameters
[in]spritePointer to sprite
[in]degreesAmount to rotate in degrees
static void C2D_SpriteSetScale ( C2D_Sprite sprite,
float  x,
float  y 
)
inlinestatic

Scale sprite (absolute)

Parameters
[in]spritePointer to sprite
[in]xX scale (negative values flip the sprite horizontally)
[in]yY scale (negative values flip the sprite vertically)