geAnim2D

From GriffinEngine
Jump to: navigation, search

Animated 2D sprite. This class is album identical to geSprite2D with the only difference being an addition of a geAnimation object that updates the sprite. To control the playback of the animation, manipulate the geAnimation object itself.


Usage

Inheritance

Base classes


Reference

Fields

Note: All coordinates are in pixels, relative to top-left corner of the window. All angles are in degrees.

  • double x; // x coordinate (px)
  • double y; // y coordinate (px)
  • double r; // rotation (degrees) - around axis point
  • double s; // scale - around axis point
  • double w; // width (px)
  • double h; // height (px)
  • double alignX; // horizontal alignment offset - use Align() to set these
  • double alignY; // vertical alignment offset
  • double axisX; // horizontal axis offset - use SetAxis() to set these
  • double axisY; // vertical axis offset
  • bool active; // indicates whether object should be active/visible
  • geSprite* sprite; // currently displayed sprite
  • geAnimation* anim; // animation

Constructors

  • geAnim2D( double _x=0, double _y=0, double _w=0, double _h=0, geAnimation* _anim=NULL );
  • geAnim2D( const geAnim2D& original ); // copy constructor

Methods

  • virtual void Align( int alignment = GE_ALIGN_TL, double _alignX = 0, double _alignY = 0 );
  • virtual void SetAxis( int axis = GE_ALIGN_CENTER, double _axisX = 0, double _axisY = 0 );