Added GetLocalBounds and GetGlobalBounds functions to drawable classes

This commit is contained in:
Laurent Gomila committed 2012-02-10 17:13:31 +01:00
1 parent 441703a997
commit cc8d8ed07b
10 files changed
+320

No files matched your search

+32
View File
@@ -300,5 +300,37 @@ CSFML_GRAPHICS_API sfIntRect sfSprite_GetTextureRect(const sfSprite* sprite);
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfColor sfSprite_GetColor(const sfSprite* sprite);
////////////////////////////////////////////////////////////
/// \brief Get the local bounding rectangle of a sprite
///
/// The returned rectangle is in local coordinates, which means
/// that it ignores the transformations (translation, rotation,
/// scale, ...) that are applied to the entity.
/// In other words, this function returns the bounds of the
/// entity in the entity's coordinate system.
///
/// \param sprite Sprite object
///
/// \return Local bounding rectangle of the entity
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfFloatRect sfSprite_GetLocalBounds(const sfSprite* sprite);
////////////////////////////////////////////////////////////
/// \brief Get the global bounding rectangle of a sprite
///
/// The returned rectangle is in global coordinates, which means
/// that it takes in account the transformations (translation,
/// rotation, scale, ...) that are applied to the entity.
/// In other words, this function returns the bounds of the
/// sprite in the global 2D world's coordinate system.
///
/// \param sprite Sprite object
///
/// \return Global bounding rectangle of the entity
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfFloatRect sfSprite_GetGlobalBounds(const sfSprite* sprite);
#endif // SFML_SPRITE_H