Oxygine  1
2g game engine
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
oxygine::ResAnim Class Reference
Inheritance diagram for oxygine::ResAnim:
oxygine::Resource oxygine::Object oxygine::ref_counter oxygine::ObjectBase oxygine::PoolObject oxygine::SingleResAnim

Public Member Functions

 ResAnim (Resource *atlas=0)
 
void init (const std::string &file, int columns=1, int rows=1, float scaleFactor=1.0f)
 
virtual void init (Image *original, int columns=1, int rows=1, float scaleFactor=1.0f)
 
void init (animationFrames &frames, int columns, float scaleFactor=1.0f, float appliedScale=1.0f)
 
void init (spNativeTexture texture, const Point &originalSize, int columns=1, int rows=1, float scaleFactor=1.0f)
 
float getScaleFactor () const
 
float getAppliedScale () const
 
int getColumns () const
 
int getRows () const
 
int getTotalFrames () const
 
int getFrameRate () const
 
const ResourcesgetResources () const
 
const AnimationFramegetFrame (int col, int row) const
 
const AnimationFramegetFrame (int index) const
 
ResourcegetAtlas ()
 
const Vector2getSize () const
 
float getWidth () const
 
float getHeight () const
 
void setFrame (int col, int row, const AnimationFrame &frame)
 
void setFrameRate (int v)
 
void removeFrames ()
 
 operator const AnimationFrame & ()
 
- Public Member Functions inherited from oxygine::Resource
void load (LoadResourcesContext *context=0)
 
void unload ()
 
pugi::xml_attribute getAttribute (const char *attr) const
 
pugi::xml_node getNode () const
 
bool getUseLoadCounter () const
 
ResourcegetParent () const
 
void setUseLoadCounter (bool v)
 
void setParent (Resource *p)
 
- Public Member Functions inherited from oxygine::Object
 Object (const Object &src)
 
 Object (bool assignUniqueID=true)
 
- Public Member Functions inherited from oxygine::ref_counter
void addRef ()
 
void releaseRef ()
 
- Public Member Functions inherited from oxygine::ObjectBase
 ObjectBase (const ObjectBase &src)
 
 ObjectBase (bool assignID=true)
 
const std::string & getName () const
 
const void * getUserData () const
 
int getObjectID () const
 
bool isName (const std::string &name) const
 
bool isName (const char *name) const
 
void setName (const std::string &name)
 
void setUserData (const void *data)
 
void dumpObject () const
 
void __removeFromDebugList ()
 

Protected Member Functions

void _load (LoadResourcesContext *ctx=0) override
 
void _unload () override
 
- Protected Member Functions inherited from oxygine::Object
void __doCheck ()
 
- Protected Member Functions inherited from oxygine::ObjectBase
void __generateID ()
 
std::string * __getName () const
 
void __freeName () const
 

Protected Attributes

int _columns
 
Resource_atlas
 
float _scaleFactor
 
float _appliedScale
 
int _framerate
 
animationFrames _frames
 
- Protected Attributes inherited from oxygine::Resource
Resource_parent
 
int _loadCounter
 
bool _useLoadCounter
 
pugi::xml_node _node
 
- Protected Attributes inherited from oxygine::ObjectBase
std::string __name
 
int __id
 
const void * __userData
 

Additional Inherited Members

- Public Types inherited from oxygine::ObjectBase
typedef std::vector< ObjectBase * > __createdObjects
 
- Static Public Member Functions inherited from oxygine::Resource
static std::string extractID (const pugi::xml_node &node, const std::string &file, const std::string &def)
 
static std::string extractID (const std::string &file)
 
- Static Public Member Functions inherited from oxygine::ObjectBase
static void dumpCreatedObjects ()
 
static void showAssertInCtor (int id)
 
static void showAssertInDtor (int id)
 
static __createdObjects & __getCreatedObjects ()
 
static void __startTracingLeaks ()
 
static void __stopTracingLeaks ()
 
- Public Attributes inherited from oxygine::ref_counter
int _ref_counter
 
- Static Protected Member Functions inherited from oxygine::Resource
static void setNode (Resource *res, const pugi::xml_node &node)
 
- Static Protected Member Functions inherited from oxygine::ObjectBase
static void __addToDebugList (ObjectBase *base)
 
static void __removeFromDebugList (ObjectBase *base)
 
- Static Protected Attributes inherited from oxygine::ObjectBase
static int _lastID
 
static int _assertCtorID
 
static int _assertDtorID
 

Member Function Documentation

◆ getAtlas()

Resource* oxygine::ResAnim::getAtlas ( )
inline

Returns atlas where this ResAnim was created

◆ getFrame()

const AnimationFrame& oxygine::ResAnim::getFrame ( int  index) const

returns frame by index ignoring cols and rows

◆ getSize()

const Vector2& oxygine::ResAnim::getSize ( ) const

Returns size of frame

◆ init()

void oxygine::ResAnim::init ( spNativeTexture  texture,
const Point originalSize,
int  columns = 1,
int  rows = 1,
float  scaleFactor = 1.0f 
)

creates animation frames from NativeTexture


The documentation for this class was generated from the following file: