ChangeAnimation

From Game Editor

Revision as of 17:36, 6 January 2009 by Skydereign (Talk | contribs)
Jump to: navigation, search
  • ChangeAnimation:

This changes the animation of a specified actor and sets the animation's initial state (FORWARD, BACKWARD, STOPPED, NO_CHANGE).


int ChangeAnimation(char *actorName, char *animationName, int state) animationName: animation valid for actorName.

  • actorName

- "Event Actor": Actor that is receiving the current event.

- "Parent Actor": Event Actor's parent, if actor has a parent.

- "Creator Actor": Event Actor's creator, if Event Actor has been created in some "Create Actor" action.

- "Collide Actor": Actor that collided with the event Actor.

- Any Actor in game.


  • int state

FORWARD // Runs the animation from the first frame, 0

BACKWARD // Runs the animation from the last frame to the first

STOPPED // Changes animation to the first frame, it does not run the animation

NO_CHANGE // Changes the animation, and keeps the same state as previous animation(s) (FORWARD, BACKWARD, STOPPED)


ex:

// Changing animation to Walk_Left

// On Key Down key_LEFT event in Script Editor

ChangeAnimaton("Event Actor","Walk_Left",FORWARD);