Please login or register.

Login with username, password and session length
Advanced search  

News:

IRC channel - server: waelisch.de  channel: #wme (read more)

Author Topic: PlayAnim with attached subframe  (Read 2185 times)

0 Members and 1 Guest are viewing this topic.

fireside

  • Supporter
  • Regular poster
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 211
    • View Profile
PlayAnim with attached subframe
« on: March 14, 2007, 12:23:35 AM »

I have two animations right now using the main actor with PlayAnim.  In the climb one, when the animation is finished, the character resumes where the animation stopped, which is very nice.  On the other one, the character swings on a rope which is an attached subframe.  In this one, the shadow of the character gets left behind, and when the animation is finished, the character returns to the starting point, not where he finished.
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: PlayAnim with attached subframe
« Reply #1 on: March 14, 2007, 03:05:12 PM »

You can see in SpriteEdit that it's possible to specify the "move X" and "move Y" values for each frame. That way the animation can affect the position of the game object (actor/entity) which plays the animation. So, if you want your swing animation to actually move your actor, you should use the move x/y values for this purpose.

Alternatively you could move the actor immediately after playing the animation.

actor.PlayAnim("swing.sprite");
actor.SkipTo(100, 200);
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

fireside

  • Supporter
  • Regular poster
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 211
    • View Profile
Re: PlayAnim with attached subframe
« Reply #2 on: March 14, 2007, 03:29:27 PM »

Oh, that's it.  I did it on the climb but not on the rope.  Thanks.
Logged
 

Page created in 0.038 seconds with 20 queries.