![]() |
Calamity Engine 1.0.0
A cross-platform 2D game engine written in C++ and SDL3.
|
#include <definitions.hpp>
Public Member Functions | |
| ShapeSprite () | |
| ShapeSprite (const std::shared_ptr< Shape > &shape) | |
| void | render (std::shared_ptr< Window > window) override |
| template<class Archive > | |
| void | save (Archive &ar) const |
| template<class Archive > | |
| void | load (Archive &ar) |
Public Member Functions inherited from Component | |
| virtual | ~Component ()=default |
| virtual void | update (float deltaTime) |
| virtual void | initialize () |
| virtual void | physicsUpdate () |
| virtual void | input (InputEvent &event) |
| virtual void | postLoad () |
| virtual void | exit () |
| Node * | getNode () const |
| void | setNode (Node *n) |
| template<class Archive > | |
| void | save (Archive &ar) const |
| template<class Archive > | |
| void | load (Archive &ar) |
Public Attributes | |
| Vector2 | origin = {0.5f, 0.5f} |
| std::shared_ptr< Shape > | shape |
| bool | visible = true |
| bool | screenSpace = false |
| Color | modulate = Color::WHITE |
A dynamic sprite (mainly used for debugging) which can draw solid color filled shapes.
Example usage:
You can make ShapeSprites render using screen space positioning. This can be used for UI elements and things like that:
Also, you can modify the modulate variable of the sprite to change its color:
|
default |
|
explicit |
|
inline |
|
overridevirtual |
Reimplemented from Component.
|
inline |
| Color ShapeSprite::modulate = Color::WHITE |
| Vector2 ShapeSprite::origin = {0.5f, 0.5f} |
| bool ShapeSprite::screenSpace = false |
| std::shared_ptr<Shape> ShapeSprite::shape |
| bool ShapeSprite::visible = true |