|
Flint Engine
Modular C++20 2D game engine powered by SDL3
|
A 2D circle rendered as a textured quad with a circle SDF shader. More...
#include <flint/graphics/circle-shape.h>
Inheritance diagram for Flint::CircleShape:
Collaboration diagram for Flint::CircleShape:Public Member Functions | |
| CircleShape (float radius, Color fill={255, 255, 255, 255}) | |
| Construct a circle with the given radius and fill color. | |
| void | setRadius (float radius) |
| Set the circle radius. | |
| void | setOrigin (Vec2f newOrigin) |
| Set the local pivot point used as the rotation and positioning origin. | |
| void | move (Vec2f delta) |
Translate the circle by delta. | |
| void | setAngle (float newAngle) |
| Set the rotation angle. | |
| float | getRadius () const |
| Get the current radius in world-space units. | |
| const Vec2f & | getOrigin () const |
| Get the local origin pivot point. | |
| float | getAngle () const |
| Return the current rotation angle in radians. | |
| FloatRect | getGlobalBounds () const override |
| Get the axis-aligned bounding box of the circle in world space. | |
| void | emit (RenderQueue &queue) const override |
| Emit this drawable's rendering work for the current frame. | |
Public Member Functions inherited from Flint::Shape | |
| virtual void | setPosition (Vec2f newPosition) |
| Set the world-space position of the shape. | |
| virtual void | setFillColor (Color color) |
| Set the fill (interior) color. | |
| virtual void | setOutlineColor (Color color) |
| Set the outline (stroke) color. | |
| virtual void | setOutlineThickness (float thickness) |
| Set the outline stroke thickness in pixels. | |
| virtual Vec2f | getPosition () const |
| Return the current world-space position. | |
| virtual Color | getFillColor () const |
| Return the current fill color. | |
| virtual Color | getOutlineColor () const |
| Return the current outline color. | |
| virtual float | getOutlineThickness () const |
| Return the current outline thickness in pixels. | |
Public Member Functions inherited from Flint::Drawable | |
| void | setGPUTexture (GPUTexture *texture) |
| Associate a texture with this drawable. | |
| GPUTexture * | getGPUTexture () const |
| Get the associated GPU texture. | |
Additional Inherited Members | |
Protected Attributes inherited from Flint::Shape | |
| Vec2f | m_position {0, 0} |
| Color | m_fillColor {255, 255, 255, 255} |
| Color | m_outlineColor {0, 0, 0, 0} |
| float | m_outlineThickness {0.f} |
Protected Attributes inherited from Flint::Drawable | |
| GPUTexture * | m_gpuTexture = nullptr |
| Non-owning reference to the GPU texture asset. | |
A 2D circle rendered as a textured quad with a circle SDF shader.
Inherits fill, outline, and position properties from Shape. Radius, rotation, and a local origin pivot are added on top.
Definition at line 16 of file circle-shape.h.