9 #ifndef _TurtleBrains_Graphic_h_
10 #define _TurtleBrains_Graphic_h_
13 #include "tb_texture_manager.h"
15 #include "../math/tb_vector.h"
99 void Update(
const float deltaTime);
158 inline void SetOrigin(
const float originX,
const float originY) { mOrigin.x = originX; mOrigin.y = originY; }
180 void SetDepth(
const float newDepth);
197 tb_error_if(scale < 0.0,
"tbExternalError: Cannot set negative scales, perhaps use SetFlipped on the Sprite?");
198 mScale.x = mScale.y = scale;
210 inline void SetScale(
const float scaleX,
const float scaleY)
212 tb_error_if(scaleX < 0.0 || scaleY < 0.0,
"tbExternalError: Cannot set negative scales, perhaps use SetFlipped on the Sprite?");
213 mScale.x = scaleX; mScale.y = scaleY;
227 inline void SetRotation(
const float rotation) { mOrientation = rotation; }
234 inline void SetScroll(
const float scroll) { mScroll.x = scroll; mScroll.y = scroll; }
244 inline void SetScroll(
const float scrollX,
const float scrollY) { mScroll.x = scrollX; mScroll.y = scrollY; }
304 virtual void OnUpdate(
const float deltaTime);
313 virtual void OnRender(
void)
const = 0;
Definition: tb_vector.h:47
void SetPosition(const float x, const float y)
Definition: tb_graphic.h:61
virtual void PopTransform(void) const
float GetHeight(void) const
Definition: tb_graphic.h:293
void SetScroll(const float scrollX, const float scrollY)
Definition: tb_graphic.h:244
This anchor will set the origin to the top and horizontal center of the Sprite.
Definition: tb_graphic.h:48
AnchorLocation
Definition: tb_graphic.h:44
virtual void OnRender(void) const =0
virtual PixelSpace GetPixelWidth(void) const
Definition: tb_graphic.h:275
const tbMath::Vector2 & GetPosition(void) const
Give the GameScene and Entities something to display, Text, Sprites and AnimatedSprites help bring th...
This anchor will set the origin to the center vertically and left most edge of the Sprite...
Definition: tb_graphic.h:50
void SetVisible(const bool isVisible)
bool IsRelative(void) const
void SetActive(const bool isActive)
This anchor will set the origin to the center of the Sprite horizontally and vertically.
Definition: tb_graphic.h:46
PixelSpace ScreenWidth(void)
PixelSpace ScreenHeight(void)
virtual void ApplyTransform(void) const
This anchor will set the origin to the top and right most corner of the Sprite.
Definition: tb_graphic.h:49
void SetOrigin(const tbMath::Vector2 &origin)
Definition: tb_graphic.h:166
float GetDepth(void) const
bool IsVisible(void) const
This anchor will set the origin to the bottom and left most corner of the Sprite. ...
Definition: tb_graphic.h:52
Here is some information about the primary namespace.
Definition: tb_application_dialog.h:21
void SetScale(const float scaleX, const float scaleY)
Definition: tb_graphic.h:210
static Vector2 Zero(void)
Definition: tb_vector.h:53
This anchor will set the origin to the bottom edge and horizontal center of the Sprite.
Definition: tb_graphic.h:53
Definition: tb_color.h:23
void SetScroll(const float scroll)
Definition: tb_graphic.h:234
This anchor will set the origin to the bottom and right most corner of the Sprite.
Definition: tb_graphic.h:54
void SetOrigin(const float originX, const float originY)
Definition: tb_graphic.h:158
tbCore::uint16 PixelSpace
Definition: tb_texture_manager.h:35
bool IsActive(void) const
float ScreenAspectRatio(void)
void SetDepth(const float newDepth)
void SetScale(const float scale)
Definition: tb_graphic.h:195
const Color & GetColor(void) const
void Update(const float deltaTime)
float GetRotation(void) const
Definition: tb_graphic.h:219
virtual PixelSpace GetPixelHeight(void) const
Definition: tb_graphic.h:281
This anchor will set the origin to the top-left corner, effectively: SetOrigin(0.0f, 0.0f).
Definition: tb_graphic.h:47
void SetRotation(const float rotation)
Definition: tb_graphic.h:227
virtual void SetColor(const tbGraphics::Color &newColor)
This anchor will set the origin to the center vertically and right most edge of the Sprite...
Definition: tb_graphic.h:51
void SetOrigin(const AnchorLocation &anchor, const tbMath::Vector2 &offset=tbMath::Vector2::Zero())
#define tb_error_if(errorTest, message,...)
Definition: tb_error.h:37
tbMath::Vector2 ScreenCenter(void)
float GetWidth(void) const
Definition: tb_graphic.h:287
virtual void OnUpdate(const float deltaTime)