diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-01-30 05:17:55 -0500 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-01-30 05:17:55 -0500 |
commit | 0334d396e4ff1b2f8a1e147b753a4de34f55c08b (patch) | |
tree | 0edd87651f04969d86943dea499be36ed8fdf6bc /src/sprite.h | |
parent | d92c7970df0d2e0a0c3f84037640336102c084a6 (diff) | |
download | tanetane-0334d396e4ff1b2f8a1e147b753a4de34f55c08b.tar.gz tanetane-0334d396e4ff1b2f8a1e147b753a4de34f55c08b.tar.bz2 tanetane-0334d396e4ff1b2f8a1e147b753a4de34f55c08b.zip |
Game now renders an image of Lucas
Diffstat (limited to 'src/sprite.h')
-rw-r--r-- | src/sprite.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/sprite.h b/src/sprite.h new file mode 100644 index 0000000..3af9341 --- /dev/null +++ b/src/sprite.h | |||
@@ -0,0 +1,33 @@ | |||
1 | #ifndef SPRITE_H_70503825 | ||
2 | #define SPRITE_H_70503825 | ||
3 | |||
4 | #include <string_view> | ||
5 | #include "renderer.h" | ||
6 | |||
7 | class Sprite { | ||
8 | public: | ||
9 | |||
10 | Sprite(std::string_view filename, Renderer& renderer); | ||
11 | |||
12 | int getTextureId() const { | ||
13 | return textureId_; | ||
14 | } | ||
15 | |||
16 | int getX() { return x_; } | ||
17 | |||
18 | int getY() { return y_; } | ||
19 | |||
20 | int getWidth() { return width_; } | ||
21 | |||
22 | int getHeight() { return height_; } | ||
23 | |||
24 | private: | ||
25 | |||
26 | int textureId_; | ||
27 | int x_ = 0; | ||
28 | int y_ = 0; | ||
29 | int width_ = 17*4; | ||
30 | int height_ = 27*4; | ||
31 | }; | ||
32 | |||
33 | #endif /* end of include guard: SPRITE_H_70503825 */ | ||