replaced separate textures with atlasses
This commit is contained in:
parent
0708a5fdbb
commit
bd9abbe5bd
12 changed files with 90 additions and 25 deletions
21
src/atlas.h
Normal file
21
src/atlas.h
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
#ifndef ATLAS_H
|
||||
#define ATLAS_H
|
||||
#include <raylib.h>
|
||||
|
||||
|
||||
class TextureAtlas {
|
||||
public:
|
||||
TextureAtlas(Texture2D* texture, int offset_x, int offset_y, int width, int height);
|
||||
TextureAtlas();
|
||||
Rectangle rect_view(int x,int y, int width, int height) const; // Get a view into texture
|
||||
Rectangle full_view() const;
|
||||
const Texture2D get_texture() const;
|
||||
private:
|
||||
int offset_x;
|
||||
int offset_y;
|
||||
int width;
|
||||
int height;
|
||||
Texture2D* texture;
|
||||
};
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue