Tramway SDK
sprite.h
Go to the documentation of this file.
1// TRAMWAY DRIFT AND DUNGEON EXPLORATION SIMULATOR 2022
2// All rights reserved.
3
4#ifndef TRAM_SDK_COMPONENTS_SPRITECOMPONENT_H
5#define TRAM_SDK_COMPONENTS_SPRITECOMPONENT_H
6
7#include <render/render.h>
8#include <render/sprite.h>
9
10namespace tram {
11
13public:
16 inline name_t GetSprite(){ return sprite->GetName(); }
17
19 this->sprite = sprite;
20 }
21
22 void Start();
23
24 void Update();
25
26 void Play();
27
28 void Pause();
29
30 void SetPlaySpeed(size_t speed);
31
33
34 void UpdateLocation(vec3 nlocation){
35 location = nlocation;
37 }
38
39 void EventHandler(Event &event){return;}
40
41protected:
43
45
46 size_t anim_frame = 0;
47 size_t anim_speed = 0;
48 size_t anim_bframe = 0;
49 bool anim_isplaying = false;
50
53};
54
55}
56
57#endif // TRAM_SDK_COMPONENTS_SPRITECOMPONENT_H
Definition: entitycomponent.h:18
Definition: sprite.h:24
Definition: resource.h:47
Definition: sprite.h:12
void UpdateLocation(vec3 nlocation)
Definition: sprite.h:34
void UpdateRenderListObject()
Definition: sprite.cpp:56
vec3 location
Definition: sprite.h:44
void SetSprite(Render::Sprite *sprite)
Definition: sprite.h:18
size_t anim_bframe
Definition: sprite.h:48
ResourceProxy< Render::Sprite > sprite
Definition: sprite.h:42
void EventHandler(Event &event)
Definition: sprite.h:39
void Pause()
Definition: sprite.cpp:118
void Update()
Definition: sprite.cpp:41
size_t anim_frame
Definition: sprite.h:46
void Start()
Definition: sprite.cpp:23
size_t anim_speed
Definition: sprite.h:47
Render::drawlistentry_t draw_list_entry
Definition: sprite.h:51
SpriteComponent()
Definition: sprite.h:14
~SpriteComponent()
Definition: sprite.cpp:17
void Play()
Definition: sprite.cpp:114
bool anim_isplaying
Definition: sprite.h:49
void SetPlaySpeed(size_t speed)
Definition: sprite.cpp:122
Render::vertexarray_t vertex_array
Definition: sprite.h:52
name_t GetSprite()
Definition: sprite.h:16
Definition: api.h:9
glm::vec3 vec3
Definition: math.h:12
Definition: event.h:24
Definition: render.h:131
void * generic
Definition: render.h:136
Definition: render.h:101
void * generic
Definition: render.h:112
Definition: uid.h:11