54 Sprite(
const std::string& shaderName,
const std::string& textureName =
"",
55 const std::string& meshName =
"1x1_mesh");
61 auto
onUpdate(
float dt) ->
void override;
67 auto load(
const Stream& stream) ->
void override;
68 auto save(
Stream& stream)
const ->
void override;
76 [[nodiscard]]
auto shown() const ->
bool;
88 [[nodiscard]] auto
isFaces() const ->
bool;
96 [[nodiscard]] auto
getText() const -> std::
string;
98 auto
setText(std::
string newText) ->
void;
109 auto
setTexture(const std::
string& textureName) ->
void;
auto to_json(json &j, const AudioObject &a) -> void
Definition AudioObject.cpp:376
auto from_json(const json &j, AudioObject &a) -> void
Definition AudioObject.cpp:387
sys::Json Stream
Definition AudioObject.h:20
The base class for components, holding all of their shared All components should inherit from this.
nlohmann::json json
Definition Json.cpp:19
ComponentTypeEnum
This enum lists out every type of component we have.
Definition Component.h:39
Component(ComponentTypeEnum type, const char *typeName)
Definition Component.cpp:72
GameObject(std::string typeName, gobj::Type parentType, gobj::Type type)
constructor for gameobject.
Definition GameObject.cpp:24
A component that renders an image on an entity, or text.
Definition Sprite.h:38
auto setShown(bool) -> void
Definition Sprite.cpp:281
std::string text
Definition Sprite.h:142
auto endWindow() -> void override
currently unused, but intended to but was assumed to be necessary for a proper ImGui editor
Definition Sprite.h:63
static auto getEnum() -> ComponentTypeEnum
Definition Sprite.h:42
auto color() -> Vector4D &
Definition Sprite.cpp:326
Sprite()
Definition Sprite.cpp:76
auto getMesh() const -> const gfx::Mesh *
Definition Sprite.cpp:381
Sprite(const Sprite &)=default
unsigned maxLineCharLength
Definition Sprite.h:143
gfx::Texture * texture
Definition Sprite.h:140
auto setTexture(gfx::Texture *newTexture) -> void
Definition Sprite.cpp:361
auto componentShowMenu() -> void override
Definition Sprite.cpp:481
auto onUpdate(float dt) -> void override
called once every frame.
Definition Sprite.cpp:102
Vector4D multColor
Definition Sprite.h:136
auto isFaces() const -> bool
Definition Sprite.cpp:316
auto drawMeshStandard(const AffineMatrix &transform) -> void
helper function to render mesh normally
Definition Sprite.cpp:128
auto getTexture() const -> const gfx::Texture *
Definition Sprite.cpp:391
auto onRender() -> void override
called every frame after update has been called for every object.
Definition Sprite.cpp:216
auto shown() const -> bool
Definition Sprite.cpp:286
gfx::Mesh * mesh
Definition Sprite.h:138
bool renderLines
Definition Sprite.h:127
auto show() -> void
Definition Sprite.cpp:271
auto setText(std::string newText) -> void
Definition Sprite.cpp:341
auto getText() const -> std::string
Definition Sprite.cpp:336
unsigned int frameIndex
Definition Sprite.h:133
auto getShader() const -> const gfx::Shader *
Definition Sprite.cpp:386
auto isWireframe() const -> bool
Definition Sprite.cpp:301
bool visible
Definition Sprite.h:124
auto setShader(gfx::Shader *newShader) -> void
Definition Sprite.cpp:356
auto drawMeshText(Transform &transform) const -> void
helper functions to draw the sprite in text mode.
Definition Sprite.cpp:141
auto hide() -> void
Definition Sprite.cpp:276
auto clone() const -> std::unique_ptr< GameObject > override
makes a copy a GameObject even if it's held polymorphically
Definition Sprite.cpp:97
auto save(Stream &stream) const -> void override
Implementations will load the state of a GameObject to a th::Json object.
Definition Sprite.cpp:266
auto showFaces() -> void
Definition Sprite.cpp:306
auto showWireframe() -> void
Definition Sprite.cpp:291
auto getOpacity() const -> float
Definition Sprite.cpp:376
auto hideFaces() -> void
Definition Sprite.cpp:311
auto setOpacity(float opacity) -> void
Definition Sprite.cpp:346
auto setFrameIndex(unsigned int index) -> void
Definition Sprite.cpp:321
gfx::Shader * shader
Definition Sprite.h:139
static auto bindLuaTypes(sol::state &lua) -> void
Definition Sprite.cpp:45
auto hideWireframe() -> void
Definition Sprite.cpp:296
auto drawDebugLines(AffineMatrix transform) -> void
helper functions to draw bounding boxes for sprites
Definition Sprite.cpp:107
bool renderFaces
Definition Sprite.h:130
~Sprite() override=default
auto load(const Stream &stream) -> void override
Implementations will load the state of a GameObject from a th::Json Object.
Definition Sprite.cpp:261
auto setMesh(gfx::Mesh *newMesh) -> void
Definition Sprite.cpp:351
holds and manages textures for use with meshes in sprites
Definition Texture.h:33
Definition FlipCardAction.h:25
Definition AffineMatrix.h:30