|
Hymn to Beauty
C++ 3D Engine
|
Component defining a 2D sprite. More...
#include <Sprite.hpp>
Public Member Functions | |
| Sprite () | |
| Create new sprite. More... | |
| ~Sprite () override | |
| Destructor. More... | |
| void | Serialize (Json::Value &node, bool load) override |
| Save or load component values to/from JSON. More... | |
Public Member Functions inherited from Component::SuperComponent | |
| SuperComponent () | |
| Create new SuperComponent. More... | |
| virtual | ~SuperComponent () |
| Destructor. More... | |
| void | Kill () |
| Kill the component, will be removed at the end of the frame. More... | |
| bool | IsKilled () const |
| Get whether component has been killed. More... | |
Public Attributes | |
| TextureAsset * | texture |
| Texture. More... | |
| float | pixelsPerUnit = 100.0f |
| How many pixels go into one world unit. More... | |
| glm::vec2 | pivot = glm::vec2(0.5, 0.5) |
| The point around which the sprite should be rotated. More... | |
| glm::vec3 | tint = glm::vec3(1.0f, 1.0f, 1.0f) |
| A color to tint the sprite with. More... | |
| float | alpha = 1.0f |
| The opacity of the sprite (multiplied with the texture's alpha channel). More... | |
| uint32_t | layerMask = 1u |
| Bitmask of which layers to render to. More... | |
Public Attributes inherited from Component::SuperComponent | |
| Entity * | entity = nullptr |
| Pointer to which entity this component corresponds. More... | |
Component defining a 2D sprite.
| Sprite::Sprite | ( | ) |
Create new sprite.
|
override |
Destructor.
|
overridevirtual |
Save or load component values to/from JSON.
| node | The JSON node to save to or load from. |
| load | Whether to load (otherwise saves). |
Implements Component::SuperComponent.
| float Component::Sprite::alpha = 1.0f |
The opacity of the sprite (multiplied with the texture's alpha channel).
| uint32_t Component::Sprite::layerMask = 1u |
Bitmask of which layers to render to.
| glm::vec2 Component::Sprite::pivot = glm::vec2(0.5, 0.5) |
The point around which the sprite should be rotated.
| float Component::Sprite::pixelsPerUnit = 100.0f |
How many pixels go into one world unit.
| TextureAsset* Component::Sprite::texture |
Texture.
| glm::vec3 Component::Sprite::tint = glm::vec3(1.0f, 1.0f, 1.0f) |
A color to tint the sprite with.