Graphics: Add origin to all sprite-based renderables (and made it a factor)

This commit is contained in:
SirLynix
2022-12-17 14:48:50 +01:00
parent 0537be3201
commit d4422c4102
12 changed files with 98 additions and 38 deletions

View File

@@ -23,6 +23,16 @@ namespace Nz
return m_textureCoords;
}
inline const Vector2f& SlicedSprite::GetOrigin() const
{
return m_origin;
}
inline const Vector2f& SlicedSprite::GetSize() const
{
return m_size;
}
inline auto SlicedSprite::GetTopLeftCorner() const -> const Corner&
{
return m_topLeftCorner;
@@ -72,6 +82,13 @@ namespace Nz
}
}
inline void SlicedSprite::SetOrigin(const Vector2f& origin)
{
m_origin = origin;
UpdateVertices();
}
inline void SlicedSprite::SetSize(const Vector2f& size)
{
m_size = size;