|
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 | |
| FLINT_API | CircleShape (float radius, Color fill={255, 255, 255, 255}) |
| Construct a circle with the given radius and fill color. | |
| FLINT_API 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. | |
| FLINT_API 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 17 of file circle-shape.h.
| FLINT_API Flint::CircleShape::CircleShape | ( | float | radius, |
| Color | fill = {255, 255, 255, 255} ) |
Construct a circle with the given radius and fill color.
| radius | Circle radius in world-space units. |
| fill | Initial fill color (default: opaque white). |
|
overridevirtual |
Emit this drawable's rendering work for the current frame.
Called once after submitted drawables have been sorted by DrawLayer. Implementations must enqueue work through queue rather than issuing immediate GPU commands.
| queue | Queue receiving this drawable's rendering work. |
Implements Flint::Drawable.
|
inlinenodiscard |
Return the current rotation angle in radians.
Definition at line 74 of file circle-shape.h.
|
inlinenodiscardoverridevirtual |
Get the axis-aligned bounding box of the circle in world space.
Reimplemented from Flint::Shape.
Definition at line 82 of file circle-shape.h.
|
inlinenodiscard |
Get the local origin pivot point.
Definition at line 69 of file circle-shape.h.
|
inlinenodiscard |
Get the current radius in world-space units.
Definition at line 64 of file circle-shape.h.
|
inline |
Translate the circle by delta.
| delta | World-space offset to add to the current position. |
Definition at line 49 of file circle-shape.h.
|
inline |
Set the rotation angle.
| newAngle | Angle in radians. |
Definition at line 59 of file circle-shape.h.
|
inline |
Set the local pivot point used as the rotation and positioning origin.
| newOrigin | Pivot offset in the local object space. |
Definition at line 40 of file circle-shape.h.
| FLINT_API void Flint::CircleShape::setRadius | ( | float | radius | ) |
Set the circle radius.
| radius | New radius in world-space units. |