#include <SFML/Config.h>
#include <SFML/Graphics/BlendMode.h>
#include <SFML/Graphics/Color.h>
#include <SFML/Graphics/Image.h>
#include <SFML/Graphics/Rect.h>
Go to the source code of this file.
Typedefs | |
typedef sfSprite | sfSprite |
sfSprite defines a sprite : texture, transformations, color, and draw on screen | |
Functions | |
CSFML_API sfSprite * | sfSprite_Create () |
Create a new sprite. | |
CSFML_API void | sfSprite_Destroy (sfSprite *Sprite) |
Destroy an existing sprite. | |
CSFML_API void | sfSprite_SetX (sfSprite *Sprite, float X) |
Set the X position of a sprite. | |
CSFML_API void | sfSprite_SetY (sfSprite *Sprite, float Y) |
Set the T position of a sprite. | |
CSFML_API void | sfSprite_SetPosition (sfSprite *Sprite, float X, float Y) |
Set the position of a sprite. | |
CSFML_API void | sfSprite_SetScaleX (sfSprite *Sprite, float Scale) |
Set the horizontal scale of a sprite. | |
CSFML_API void | sfSprite_SetScaleY (sfSprite *Sprite, float Scale) |
Set the vertical scale of a sprite. | |
CSFML_API void | sfSprite_SetScale (sfSprite *Sprite, float ScaleX, float ScaleY) |
Set the scale of a sprite. | |
CSFML_API void | sfSprite_SetRotation (sfSprite *Sprite, float Rotation) |
Set the orientation of a sprite. | |
CSFML_API void | sfSprite_SetCenter (sfSprite *Sprite, float X, float Y) |
Set the center of a sprite, in coordinates relative to its left-top corner. | |
CSFML_API void | sfSprite_SetColor (sfSprite *Sprite, sfColor Color) |
Set the color of a sprite. | |
CSFML_API void | sfSprite_SetBlendMode (sfSprite *Sprite, sfBlendMode Mode) |
Set the blending mode for a sprite. | |
CSFML_API float | sfSprite_GetX (sfSprite *Sprite) |
Get the X position of a sprite. | |
CSFML_API float | sfSprite_GetY (sfSprite *Sprite) |
Get the Y position of a sprite. | |
CSFML_API float | sfSprite_GetScaleX (sfSprite *Sprite) |
Get the horizontal scale of a sprite. | |
CSFML_API float | sfSprite_GetScaleY (sfSprite *Sprite) |
Get the vertical scale of a sprite. | |
CSFML_API float | sfSprite_GetRotation (sfSprite *Sprite) |
Get the orientation of a sprite. | |
CSFML_API float | sfSprite_GetCenterX (sfSprite *Sprite) |
Get the X position of the center a sprite. | |
CSFML_API float | sfSprite_GetCenterY (sfSprite *Sprite) |
Get the Y position of the center a sprite. | |
CSFML_API sfColor | sfSprite_GetColor (sfSprite *Sprite) |
Get the color of a sprite. | |
CSFML_API sfBlendMode | sfSprite_GetBlendMode (sfSprite *Sprite) |
Get the current blending mode of a sprite. | |
CSFML_API void | sfSprite_Move (sfSprite *Sprite, float OffsetX, float OffsetY) |
Move a sprite. | |
CSFML_API void | sfSprite_Scale (sfSprite *Sprite, float FactorX, float FactorY) |
Scale a sprite. | |
CSFML_API void | sfSprite_Rotate (sfSprite *Sprite, float Angle) |
Rotate a sprite. | |
CSFML_API void | sfSprite_TransformToLocal (sfSprite *Sprite, float PointX, float PointY, float *X, float *Y) |
Transform a point from global coordinates into the sprite's local coordinates (ie it applies the inverse of object's center, translation, rotation and scale to the point). | |
CSFML_API void | sfSprite_TransformToGlobal (sfSprite *Sprite, float PointX, float PointY, float *X, float *Y) |
Transform a point from the sprite's local coordinates into global coordinates (ie it applies the object's center, translation, rotation and scale to the point). | |
CSFML_API void | sfSprite_SetImage (sfSprite *Sprite, sfImage *Image) |
Change the image of a sprite. | |
CSFML_API void | sfSprite_SetSubRect (sfSprite *Sprite, const sfIntRect *SubRect) |
Set the sub-rectangle of a sprite inside the source image. | |
CSFML_API void | sfSprite_Resize (sfSprite *Sprite, float Width, float Height) |
Resize a sprite (by changing its scale factors). | |
CSFML_API void | sfSprite_FlipX (sfSprite *Sprite, sfBool Flipped) |
Flip a sprite horizontally. | |
CSFML_API void | sfSprite_FlipY (sfSprite *Sprite, sfBool Flipped) |
Flip a sprite vertically. | |
CSFML_API sfImage * | sfSprite_GetImage (sfSprite *Sprite) |
Get the source image of a sprite. | |
CSFML_API sfIntRect * | sfSprite_GetSubRect (sfSprite *Sprite) |
Get the sub-rectangle of a sprite inside the source image. | |
CSFML_API float | sfSprite_GetWidth (sfSprite *Sprite) |
Get a sprite width. | |
CSFML_API float | sfSprite_GetHeight (sfSprite *Sprite) |
Get a sprite height. | |
CSFML_API sfColor | sfSprite_GetPixel (sfSprite *Sprite, unsigned int X, unsigned int Y) |
Get the color of a given pixel in a sprite. |
CSFML_API sfSprite* sfSprite_Create | ( | ) |
Create a new sprite.
CSFML_API void sfSprite_Destroy | ( | sfSprite * | Sprite | ) |
Destroy an existing sprite.
Sprite | : Sprite to delete |
Flip a sprite horizontally.
Sprite | : Sprite to modify | |
Flipped | : sfTrue to flip the sprite |
Flip a sprite vertically.
Sprite | : Sprite to modify | |
Flipped | : sfTrue to flip the sprite |
CSFML_API sfBlendMode sfSprite_GetBlendMode | ( | sfSprite * | Sprite | ) |
Get the current blending mode of a sprite.
Sprite | : Sprite to read |
CSFML_API float sfSprite_GetCenterX | ( | sfSprite * | Sprite | ) |
Get the X position of the center a sprite.
Sprite | : Sprite to read |
CSFML_API float sfSprite_GetCenterY | ( | sfSprite * | Sprite | ) |
Get the Y position of the center a sprite.
Sprite | : Sprite to read |
Get the color of a sprite.
Sprite | : Sprite to read |
CSFML_API float sfSprite_GetHeight | ( | sfSprite * | Sprite | ) |
Get a sprite height.
Sprite | : Sprite to read |
Get the source image of a sprite.
Sprite | : Sprite to read |
Get the color of a given pixel in a sprite.
Sprite | : Sprite to read | |
X | : X coordinate of the pixel to get | |
Y | : Y coordinate of the pixel to get |
CSFML_API float sfSprite_GetRotation | ( | sfSprite * | Sprite | ) |
Get the orientation of a sprite.
Sprite | : Sprite to read |
CSFML_API float sfSprite_GetScaleX | ( | sfSprite * | Sprite | ) |
Get the horizontal scale of a sprite.
Sprite | : Sprite to read |
CSFML_API float sfSprite_GetScaleY | ( | sfSprite * | Sprite | ) |
Get the vertical scale of a sprite.
Sprite | : Sprite to read |
Get the sub-rectangle of a sprite inside the source image.
Sprite | : Sprite to read |
CSFML_API float sfSprite_GetWidth | ( | sfSprite * | Sprite | ) |
Get a sprite width.
Sprite | : Sprite to read |
CSFML_API float sfSprite_GetX | ( | sfSprite * | Sprite | ) |
Get the X position of a sprite.
Sprite | : Sprite to read |
CSFML_API float sfSprite_GetY | ( | sfSprite * | Sprite | ) |
Get the Y position of a sprite.
Sprite | : Sprite to read |
CSFML_API void sfSprite_Move | ( | sfSprite * | Sprite, | |
float | OffsetX, | |||
float | OffsetY | |||
) |
Move a sprite.
Sprite | : Sprite to modify | |
OffsetX | : Offset on the X axis | |
OffsetY | : Offset on the Y axis |
CSFML_API void sfSprite_Resize | ( | sfSprite * | Sprite, | |
float | Width, | |||
float | Height | |||
) |
Resize a sprite (by changing its scale factors).
Sprite | : Sprite to modify | |
Width | : New width (must be strictly positive) | |
Height | : New height (must be strictly positive) |
CSFML_API void sfSprite_Rotate | ( | sfSprite * | Sprite, | |
float | Angle | |||
) |
Rotate a sprite.
Sprite | : Sprite to modify | |
Angle | : Angle of rotation, in degrees |
CSFML_API void sfSprite_Scale | ( | sfSprite * | Sprite, | |
float | FactorX, | |||
float | FactorY | |||
) |
Scale a sprite.
Sprite | : Sprite to modify | |
FactorX | : Horizontal scaling factor (must be strictly positive) | |
FactorY | : Vertical scaling factor (must be strictly positive) |
CSFML_API void sfSprite_SetBlendMode | ( | sfSprite * | Sprite, | |
sfBlendMode | Mode | |||
) |
Set the blending mode for a sprite.
Sprite | : Sprite to modify | |
Mode | : New blending mode |
CSFML_API void sfSprite_SetCenter | ( | sfSprite * | Sprite, | |
float | X, | |||
float | Y | |||
) |
Set the center of a sprite, in coordinates relative to its left-top corner.
Sprite | : Sprite to modify | |
X | : X coordinate of the center | |
Y | : Y coordinate of the center |
Set the color of a sprite.
Sprite | : Sprite to modify | |
Color | : New color |
Change the image of a sprite.
Sprite | : Sprite to modify | |
Image | : New image |
CSFML_API void sfSprite_SetPosition | ( | sfSprite * | Sprite, | |
float | X, | |||
float | Y | |||
) |
Set the position of a sprite.
Sprite | : Sprite to modify | |
X | : New X coordinate | |
Y | : New Y coordinate |
CSFML_API void sfSprite_SetRotation | ( | sfSprite * | Sprite, | |
float | Rotation | |||
) |
Set the orientation of a sprite.
Sprite | : Sprite to modify | |
Rotation | : Angle of rotation, in degrees |
CSFML_API void sfSprite_SetScale | ( | sfSprite * | Sprite, | |
float | ScaleX, | |||
float | ScaleY | |||
) |
Set the scale of a sprite.
Sprite | : Sprite to modify | |
ScaleX | : New horizontal scale (must be strictly positive) | |
ScaleY | : New vertical scale (must be strictly positive) |
CSFML_API void sfSprite_SetScaleX | ( | sfSprite * | Sprite, | |
float | Scale | |||
) |
Set the horizontal scale of a sprite.
Sprite | : Sprite to modify | |
Scale | : New scale (must be strictly positive) |
CSFML_API void sfSprite_SetScaleY | ( | sfSprite * | Sprite, | |
float | Scale | |||
) |
Set the vertical scale of a sprite.
Sprite | : Sprite to modify | |
Scale | : New scale (must be strictly positive) |
Set the sub-rectangle of a sprite inside the source image.
Sprite | : Sprite to modify | |
SubRect | : New sub-rectangle |
CSFML_API void sfSprite_SetX | ( | sfSprite * | Sprite, | |
float | X | |||
) |
Set the X position of a sprite.
Sprite | : Sprite to modify | |
X | : New X coordinate |
CSFML_API void sfSprite_SetY | ( | sfSprite * | Sprite, | |
float | Y | |||
) |
Set the T position of a sprite.
Sprite | : Sprite to modify | |
Y | : New Y coordinate |
CSFML_API void sfSprite_TransformToGlobal | ( | sfSprite * | Sprite, | |
float | PointX, | |||
float | PointY, | |||
float * | X, | |||
float * | Y | |||
) |
Transform a point from the sprite's local coordinates into global coordinates (ie it applies the object's center, translation, rotation and scale to the point).
Sprite | : Sprite object | |
PointX | : X coordinate of the point to transform | |
PointY | : Y coordinate of the point to transform | |
X | : Value to fill with the X coordinate of the converted point | |
Y | : Value to fill with the y coordinate of the converted point |
CSFML_API void sfSprite_TransformToLocal | ( | sfSprite * | Sprite, | |
float | PointX, | |||
float | PointY, | |||
float * | X, | |||
float * | Y | |||
) |
Transform a point from global coordinates into the sprite's local coordinates (ie it applies the inverse of object's center, translation, rotation and scale to the point).
Sprite | : Sprite object | |
PointX | : X coordinate of the point to transform | |
PointY | : Y coordinate of the point to transform | |
X | : Value to fill with the X coordinate of the converted point | |
Y | : Value to fill with the y coordinate of the converted point |