TurtleBrains  0.3.5
High quality, portable, C++ framework for rapid 2D game development.
TurtleBrains::Graphics::OutlinedCircleShape Class Reference

#include <tb_basic_shapes.hpp>

Inheritance diagram for TurtleBrains::Graphics::OutlinedCircleShape:
TurtleBrains::Graphics::OutlinedPolygonShape TurtleBrains::Graphics::PolygonShape TurtleBrains::Graphics::Graphic

Public Member Functions

 OutlinedCircleShape (const float radius=64.0f, const tbGraphics::Color &fillColor=tbGraphics::ColorPalette::White, const tbGraphics::Color &outlineColor=tbGraphics::ColorPalette::Black, const tbMath::Vector2 &position=tbMath::Vector2::Zero(), const int sectionCount=30)
 
virtual ~OutlinedCircleShape (void)
 
- Public Member Functions inherited from TurtleBrains::Graphics::OutlinedPolygonShape
 OutlinedPolygonShape (void)
 
 OutlinedPolygonShape (const OutlinedPolygonShape &other)
 
virtual ~OutlinedPolygonShape (void)
 
virtual void ClearVertices (void) override
 
void SetFillColor (const tbGraphics::Color &fillColor)
 
void SetOutlineColor (const tbGraphics::Color &outlineColor)
 
- Public Member Functions inherited from TurtleBrains::Graphics::PolygonShape
 PolygonShape (void)
 
 PolygonShape (const PolygonShape &other)
 
 PolygonShape (PolygonShape &&other) noexcept
 
virtual ~PolygonShape (void)
 
PolygonShapeoperator= (const PolygonShape &other)
 
PolygonShapeoperator= (PolygonShape &&other) noexcept
 
virtual PixelSpace GetPixelWidth (void) const override
 
virtual PixelSpace GetPixelHeight (void) const override
 
void SetAsTriangles (void)
 
void SetAsTriangleFan (void)
 
void SetAsTriangleStrip (void)
 
void SetAsLines (void)
 
void SetAsLineStrip (void)
 
void SetAsLineLoop (void)
 
void SetVertexPosition (size_t vertexIndex, const tbMath::Vector2 &position)
 
void RecomputeBounds (void)
 
- Public Member Functions inherited from TurtleBrains::Graphics::Graphic
 Graphic (void)
 
 Graphic (const Graphic &other)=default
 
virtual ~Graphic (void)=default
 
Graphicoperator= (const Graphic &other)=default
 
bool IsActive (void) const
 
void SetActive (const bool isActive)
 
void Update (const float deltaTime)
 
bool IsVisible (void) const
 
void SetVisible (const bool isVisible)
 
void Render (void) const
 
const tbMath::Vector2GetPosition (void) const
 
void SetPosition (const float x, const float y)
 
void SetPosition (const tbMath::Vector2 &position)
 
const tbMath::Vector2GetOrigin (void) const
 
void SetOrigin (const AnchorLocation &anchor, const float offsetX, const float offsetY)
 
void SetOrigin (const AnchorLocation &anchor, const tbMath::Vector2 &offset=tbMath::Vector2::Zero())
 
void SetOrigin (const float originX, const float originY)
 
void SetOrigin (const tbMath::Vector2 &origin)
 
float GetDepth (void) const
 
void SetDepth (const float newDepth)
 
const tbMath::Vector2GetScale (void) const
 
void SetScale (const float scale)
 
void SetScale (const tbMath::Vector2 &scale)
 
void SetScale (const float scaleX, const float scaleY)
 
tbMath::Angle GetRotation (void) const
 
void SetRotation (const tbMath::Angle &angle)
 
void SetScroll (const float scroll)
 
void SetScroll (const float scrollX, const float scrollY)
 
bool IsRelative (void) const
 
const ColorGetColor (void) const
 
float GetWidth (void) const
 
float GetHeight (void) const
 
float GetScaledWidth (void) const
 
float GetScaledHeight (void) const
 
tbMath::Vector2 GetAnchorPosition (const tbGraphics::AnchorLocation &anchor, const float offsetX, const float offsetY) const
 
tbMath::Vector2 GetAnchorPosition (const tbGraphics::AnchorLocation &anchor, const tbMath::Vector2 &offset=tbMath::Vector2::Zero()) const
 
bool UnstableIsPointContained (const tbMath::Vector2 &point) const
 

Additional Inherited Members

- Protected Member Functions inherited from TurtleBrains::Graphics::OutlinedPolygonShape
void AddOutlineVertex (const tbMath::Vector2 &position, const tbMath::Vector2 &uv=tbMath::Vector2::Zero())
 
void AddShapeVertex (const tbMath::Vector2 &position, const tbMath::Vector2 &uv=tbMath::Vector2::Zero())
 
void AddShapeAndOutlineVertex (const tbMath::Vector2 &position, const tbMath::Vector2 &uv=tbMath::Vector2::Zero())
 
virtual void OnRender (void) const override
 
- Protected Member Functions inherited from TurtleBrains::Graphics::Graphic
virtual void OnUpdate (const float deltaTime)
 
virtual void ApplyTransform (void) const
 
virtual void PopTransform (void) const
 

Detailed Description

The OutlinedCircleShape is a special case of the OutlinedPolygonShape that creates a circle with a specified radius and color to be displayed in a scene.

Constructor & Destructor Documentation

◆ OutlinedCircleShape()

TurtleBrains::Graphics::OutlinedCircleShape::OutlinedCircleShape ( const float  radius = 64.0f,
const tbGraphics::Color fillColor = tbGraphics::ColorPalette::White,
const tbGraphics::Color outlineColor = tbGraphics::ColorPalette::Black,
const tbMath::Vector2 position = tbMath::Vector2::Zero(),
const int  sectionCount = 30 
)
explicit

Constructs a PolygonShape in the form of a circle with specified size, position and color.

Parameters
radiusThe size of the circle, in pixels unless the projection or view matrix changes.
fillColorThe desired color of the circle when it renders.
outlineColorThe desired color of the outline when rendering.
positionThe position of the center of the circle. //TODO: TurtleBrains: Documentation: Check this fact and make sure it works as intended with anchor points.
sectionCountHow many triangle sections the circle should be broken down to, more sections results in a smoother curve but also takes more rendering time and memory. In general smaller circles can reduce the number of sections while larger circles need more sections to be visually smooth.

◆ ~OutlinedCircleShape()

virtual TurtleBrains::Graphics::OutlinedCircleShape::~OutlinedCircleShape ( void  )
virtual

Cleans up after the OutlinedCircleShape