|
Monad Engine da02fba2
> Undercity Codex_
|
#include <SpriteComponent.h>
Inheritance diagram for eng::SpriteComponent:
Collaboration diagram for eng::SpriteComponent:Public Member Functions | |
| void | LoadProperties (const nlohmann::json &json) override |
| void | Update (float deltaTime) override |
| void | SetTexture (const std::shared_ptr< Texture > &texture) |
| const std::shared_ptr< Texture > & | GetTexture () const |
| void | SetColor (const glm::vec4 &color) |
| const glm::vec4 & | GetColor () const |
| void | SetSize (const glm::vec2 &size) |
| const glm::vec2 & | GetSize () const |
| void | SetLowerLeftUV (const glm::vec2 &uv) |
| const glm::vec2 & | GetLowerLeftUV () const |
| void | SetUpperRightUV (const glm::vec2 &uv) |
| const glm::vec2 & | GetUpperRightUV () const |
| void | SetUV (const glm::vec2 &lowerLeftUV, const glm::vec2 &upperRightUV) |
| void | SetPivot (const glm::vec2 &pivot) |
| const glm::vec2 & | GetPivot () const |
| void | SetVisibile (bool visible) |
| bool | IsVisible () const |
| virtual void | Init () |
| virtual size_t | GetTypeId () const =0 |
| GameObject * | GetOwner () |
Static Public Member Functions | |
| template<typename T > | |
| static size_t | StaticTypeId () |
Protected Attributes | |
| GameObject * | m_owner = nullptr |
Definition at line 13 of file SpriteComponent.h.
| const glm::vec4 & eng::SpriteComponent::GetColor | ( | ) | const |
Definition at line 113 of file SpriteComponent.cpp.
| const glm::vec2 & eng::SpriteComponent::GetLowerLeftUV | ( | ) | const |
Definition at line 133 of file SpriteComponent.cpp.
|
inherited |
Definition at line 15 of file Component.cpp.
References eng::Component::m_owner.
Referenced by eng::MeshComponent::Update(), and Update().
| const glm::vec2 & eng::SpriteComponent::GetPivot | ( | ) | const |
Definition at line 159 of file SpriteComponent.cpp.
| const glm::vec2 & eng::SpriteComponent::GetSize | ( | ) | const |
Definition at line 123 of file SpriteComponent.cpp.
| const std::shared_ptr< Texture > & eng::SpriteComponent::GetTexture | ( | ) | const |
Definition at line 103 of file SpriteComponent.cpp.
|
pure virtualinherited |
| const glm::vec2 & eng::SpriteComponent::GetUpperRightUV | ( | ) | const |
Definition at line 143 of file SpriteComponent.cpp.
|
virtualinherited |
Reimplemented in eng::PhysicsComponent, and eng::PlayerControllerComponent.
Definition at line 11 of file Component.cpp.
Referenced by eng::GameObject::AddComponent().
| bool eng::SpriteComponent::IsVisible | ( | ) | const |
Definition at line 169 of file SpriteComponent.cpp.
|
overridevirtual |
Reimplemented from eng::Component.
Definition at line 11 of file SpriteComponent.cpp.
References eng::Texture::Load(), SetColor(), SetLowerLeftUV(), SetPivot(), SetSize(), SetTexture(), and SetUpperRightUV().
| void eng::SpriteComponent::SetColor | ( | const glm::vec4 & | color | ) |
Definition at line 108 of file SpriteComponent.cpp.
Referenced by LoadProperties().
| void eng::SpriteComponent::SetLowerLeftUV | ( | const glm::vec2 & | uv | ) |
Definition at line 128 of file SpriteComponent.cpp.
Referenced by LoadProperties().
| void eng::SpriteComponent::SetPivot | ( | const glm::vec2 & | pivot | ) |
Definition at line 154 of file SpriteComponent.cpp.
Referenced by LoadProperties().
| void eng::SpriteComponent::SetSize | ( | const glm::vec2 & | size | ) |
Definition at line 118 of file SpriteComponent.cpp.
Referenced by LoadProperties().
| void eng::SpriteComponent::SetTexture | ( | const std::shared_ptr< Texture > & | texture | ) |
Definition at line 98 of file SpriteComponent.cpp.
Referenced by LoadProperties().
| void eng::SpriteComponent::SetUpperRightUV | ( | const glm::vec2 & | uv | ) |
Definition at line 138 of file SpriteComponent.cpp.
Referenced by LoadProperties().
| void eng::SpriteComponent::SetUV | ( | const glm::vec2 & | lowerLeftUV, |
| const glm::vec2 & | upperRightUV | ||
| ) |
Definition at line 148 of file SpriteComponent.cpp.
| void eng::SpriteComponent::SetVisibile | ( | bool | visible | ) |
Definition at line 164 of file SpriteComponent.cpp.
|
inlinestaticinherited |
Definition at line 26 of file Component.h.
|
overridevirtual |
Implements eng::Component.
Definition at line 78 of file SpriteComponent.cpp.
References eng::RenderCommand2D::color, eng::Engine::GetInstance(), eng::Component::GetOwner(), eng::Engine::GetRenderQueue(), eng::GameObject::GetWorldTransform2D(), eng::RenderCommand2D::lowerLeftUV, eng::RenderCommand2D::modelMatrix, eng::RenderCommand2D::pivot, eng::RenderCommand2D::size, eng::RenderQueue::Submit(), eng::RenderCommand2D::texture, and eng::RenderCommand2D::upperRightUV.
|
protectedinherited |
Definition at line 33 of file Component.h.
Referenced by eng::GameObject::AddComponent(), eng::Component::GetOwner(), eng::CameraComponent::GetViewMatrix(), eng::PhysicsComponent::Init(), eng::PlayerControllerComponent::Init(), eng::AudioComponent::Update(), eng::AudioListenerComponent::Update(), eng::PhysicsComponent::Update(), and eng::PlayerControllerComponent::Update().