summary refs log tree commit diff stats
path: root/src/components/sprite_renderable.h
blob: b4465c3ceab20e740b08ba427c1ef46a0c992f97 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#ifndef SPRITE_RENDERABLE_H_D3AACBBF
#define SPRITE_RENDERABLE_H_D3AACBBF

#include "component.h"
#include "renderer.h"

class SpriteRenderableComponent : public Component {
  public:
    SpriteRenderableComponent(const char* filename, int frame_width, int frame_height, int frames_across);
    
    int getFrame() const;
    void setFrame(int frame);
    
    const Texture& getTexture() const;
    Rectangle getFrameRect() const;
    
  private:
    Texture texture;
    int frame_width;
    int frame_height;
    int frames_across;
    int frame = 0;
};

#endif /* end of include guard: SPRITE_RENDERABLE_H_D3AACBBF */