Meteor2D  dev internal
Meteor is a lightweight 2D game engine.
Loading...
Searching...
No Matches
sprite2d.h
1#pragma once
2#include <meteorutils/logging.h>
3#include <entities/spatial.h>
4#include <2d/texture.h>
5#include <2d/texrendercmd.h>
6
7namespace meteor {
11 class MSprite2D : public MSpatialEntity {
12 public:
19 MSprite2D(std::string texPath, ERenderLayer layer, uint8_t sortingOrder);
26 MSprite2D(MTexture* texture, ERenderLayer layer, uint8_t sortingOrder);
27 void onUpdate(float deltaTime) override;
28 void onExit() override;
33 void setPivot(SVector2 normVal) { pivot = normVal; };
38 inline SVector2 getPivot() { return pivot; }
39 private:
40 SVector2 texSize;
41 SVector2 pivot;
42 MTexture* texture = NULL;
43 MTexRenderCmd* cmd = NULL;
44 };
45}
Spatial Entity is the base entity for all types present in scene. This entity keeps track of spatial ...
Definition spatial.h:15
This entity enables sprite rendering in meteor.
Definition sprite2d.h:11
void setPivot(SVector2 normVal)
Set the pivot of the sprite.
Definition sprite2d.h:33
SVector2 getPivot()
Get the pivot of the sprite.
Definition sprite2d.h:38
MSprite2D(std::string texPath, ERenderLayer layer, uint8_t sortingOrder)
constructor
MSprite2D(MTexture *texture, ERenderLayer layer, uint8_t sortingOrder)
constructor
This a RenderCommand that draws an image on to the screen.
Definition texrendercmd.h:11
This class holds an image that can be rendererd to the screen.
Definition texture.h:12
A structure representing a 2D Vector.
Definition vector2d.h:11