2 #include "oxygine-include.h" 4 #include "AnimationFrame.h" 5 #include "core/Texture.h" 10 typedef std::vector<AnimationFrame> animationFrames;
12 DECLARE_SMART(ResAnim, spResAnim);
20 void init(
const std::string& file,
int columns = 1,
int rows = 1,
float scaleFactor = 1.0f);
21 virtual void init(
Image* original,
int columns = 1,
int rows = 1,
float scaleFactor = 1.0f);
22 void init(animationFrames& frames,
int columns,
float scaleFactor = 1.0f,
float appliedScale = 1.0f);
24 void init(spNativeTexture texture,
const Point& originalSize,
int columns = 1,
int rows = 1,
float scaleFactor = 1.0f);
29 float getScaleFactor()
const {
return _scaleFactor;}
30 float getAppliedScale()
const {
return _appliedScale; }
31 int getColumns()
const {
return _columns;}
32 int getRows()
const {
return (
int)_frames.size() / _columns;}
33 int getTotalFrames()
const {
return (
int)_frames.size();}
34 int getFrameRate()
const {
return _framerate; }
43 float getWidth()
const;
44 float getHeight()
const;
47 void setFrameRate(
int v) { _framerate = v; }
50 operator const AnimationFrame& ();
54 void _load(LoadResourcesContext* ctx = 0)
override;
55 void _unload()
override;
63 animationFrames _frames;
Definition: AnimationFrame.h:28
–oxgl-end–!
Definition: Actor.h:14
Definition: Resource.h:10
Resource * getAtlas()
Definition: ResAnim.h:40
Definition: Resources.h:43
const Vector2 & getSize() const