glTranslated(mPos.x,mPos.y,0);//move to position
glTranslated(frame->animationPeg.x,frame->animationPeg.y,0);//move back to where it was
glRotatef(mAngle,0.0f,0.0f,1.0f);//rotate shape
+ glScaled(mScale);
glTranslated(-frame->animationPeg.x,-frame->animationPeg.y,0);//place animation peg on origin
glBindTexture(GL_TEXTURE_2D, frame->image);
glBegin( GL_QUADS );
SpriteFrame* getAnimation(){ return &mActor.mAnimations[mActor.mCurrentAnimation]->mFrames[mActor.mFrame]; }/**< returns active animation. (actually the current frame within the animation) \todo see if this is slower maybe undo */
void setFrame(int frame) { mActor.mFrame = frame; }/**< cahnges to the specified frame of the animation beginning at 0. */
int getFrame() { return mActor.mFrame; }/**< returns active frame. */
- void setSpeed(float speed) {mSpeed = speed;}/**< sets the Sprite's speed. */
- float getSpeed() {return mSpeed;}/**< returns a Sprite's current speed. */
- std::string getName(){ return mName;}/**< returns the Sprite's name */
- void toggleAnim(){ mAnimating = !mAnimating;}/**< Pauses or resumes an animation. */
- void startAnim() {mAnimating = 1;}/**< Causes the animation to play. */
- void stopAnim() {mAnimating = 0;}/**< Causes the animation to stop. */
- void rewind() {mActor.mFrame = 0;}/**< Resets the Sprite's animation to the first frame. */
+ void setSpeed(float speed) { mSpeed = speed; }/**< sets the Sprite's speed. */
+ float getSpeed() { return mSpeed;}/**< returns a Sprite's current speed. */
+ std::string getName(){ return mName; }/**< returns the Sprite's name */
+ void toggleAnim(){ mAnimating = !mAnimating; }/**< Pauses or resumes an animation. */
+ void startAnim() {mAnimating = 1; }/**< Causes the animation to play. */
+ void stopAnim() {mAnimating = 0; }/**< Causes the animation to stop. */
+ void rewind() {mActor.mFrame = 0; }/**< Resets the Sprite's animation to the first frame. */
void draw();/**< draws Sprite. */
void drawCollisions();/**< Draws Collision data for the Object (from outside) */
Sprite* collisionWithSprite(string name);/**< checks for collision with sprite of a given name. */
bool mVisible;/**< Determine if Object should be visible */
float mTransparency;/**< Transparency! */
float mAngle;/**< Angle of rotation */
+ float mScale;/**< Scale for the sprite*/
int ZOrder;/**< Stacking order. Determines what draws on top. \todo implement. */
};
#endif