47 Sprite(
const std::string& shaderName,
const std::string& textureName =
"",
48 const std::string& meshName =
"1x1_mesh");
54 auto
onUpdate(
float dt) ->
void override;
60 auto load(
const Stream& stream) ->
void override;
61 auto save(
Stream& stream)
const ->
void override;
67 [[nodiscard]]
auto shown() const ->
bool;
79 [[nodiscard]] auto
isFaces() const ->
bool;
87 [[nodiscard]] auto
getText() const -> std::
string;
89 auto
setText(std::
string newText) ->
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
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:23
A component that renders an image on an entity, or text.
Definition Sprite.h:38
std::string text
Definition Sprite.h:130
auto endWindow() -> void override
currently unused, but intended to but was assumed to be necessary for a proper ImGui editor
Definition Sprite.h:56
auto color() -> Vector4D &
Definition Sprite.cpp:283
Sprite()
Definition Sprite.cpp:42
auto getMesh() const -> const gfx::Mesh *
Definition Sprite.cpp:328
Sprite(const Sprite &)=default
unsigned maxLineCharLength
Definition Sprite.h:131
gfx::Texture * texture
Definition Sprite.h:128
auto setTexture(gfx::Texture *newTexture) -> void
Definition Sprite.cpp:318
auto componentShowMenu() -> void override
Definition Sprite.cpp:554
auto onUpdate(float dt) -> void override
called once every frame.
Definition Sprite.cpp:68
Vector4D multColor
Definition Sprite.h:124
auto isFaces() const -> bool
Definition Sprite.cpp:273
auto drawMeshStandard(const AffineMatrix &transform) -> void
helper function to render mesh normaly
Definition Sprite.cpp:90
auto getTexture() const -> const gfx::Texture *
Definition Sprite.cpp:338
auto onRender() -> void override
called every frame after update has been called for every object.
Definition Sprite.cpp:178
auto shown() const -> bool
Definition Sprite.cpp:243
gfx::Mesh * mesh
Definition Sprite.h:126
bool renderLines
Definition Sprite.h:115
auto show() -> void
Definition Sprite.cpp:233
auto setText(std::string newText) -> void
Definition Sprite.cpp:298
auto getText() const -> std::string
Definition Sprite.cpp:293
unsigned int frameIndex
Definition Sprite.h:121
auto getShader() const -> const gfx::Shader *
Definition Sprite.cpp:333
auto isWireframe() const -> bool
Definition Sprite.cpp:258
bool visible
Definition Sprite.h:112
auto setShader(gfx::Shader *newShader) -> void
Definition Sprite.cpp:313
auto drawMeshText(Transform &transform) const -> void
helper functions to draw the sprite in text mode.
Definition Sprite.cpp:103
auto hide() -> void
Definition Sprite.cpp:238
auto clone() const -> std::unique_ptr< GameObject > override
makes a copy a GameObject even if it's held polymorphically
Definition Sprite.cpp:63
auto save(Stream &stream) const -> void override
Implementations will load the state of a GameObject to a th::Json object.
Definition Sprite.cpp:228
auto showFaces() -> void
Definition Sprite.cpp:263
auto showWireframe() -> void
Definition Sprite.cpp:248
auto getOpacity() const -> float
Definition Sprite.cpp:323
auto hideFaces() -> void
Definition Sprite.cpp:268
auto setOpacity(float opacity) -> void
Definition Sprite.cpp:303
auto setFrameIndex(unsigned int index) -> void
Definition Sprite.cpp:278
gfx::Shader * shader
Definition Sprite.h:127
auto hideWireframe() -> void
Definition Sprite.cpp:253
auto drawDebugLines(AffineMatrix transform) -> void
helper functions to draw bounding boxes for sprites
Definition Sprite.cpp:73
bool renderFaces
Definition Sprite.h:118
~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:223
auto setMesh(gfx::Mesh *newMesh) -> void
Definition Sprite.cpp:308
holds and manages textures for use with meshes in sprites
Definition Texture.h:33
Definition AffineMatrix.h:30