Unusual sprite sheet usage for new animation syste

edited June 2017 in General discussions
In the case of a sprite sheet like in the beginners tutorial here:

http://orx-project.org/wiki/_media/guides/beginners/jelly.png

The simple animation would be just:

[JellyAnimationSet]
Texture			= jelly.png
FrameSize		= (32, 32, 0)
JellyWobbleAnim		= -1
StartAnim		= JellyWobbleAnim
JellyWobbleAnim->	= JellyWobbleAnim
Pivot			= center

So the animation frames would autopick as [1] [2] [3].

How would I set the animation as:

[1] [2] [3] [2] ?

Comments

  • edited June 2017
    Well, you have two main options there:
    • you can actually have two separate animations (either [1] [2] + [3] [2] or [1] [2] [3] + [2]) that are chained in the graph (you'll never interact directly with the second animation, but every time you'll go through the first one, the second one will happen right away)
    • you need to do a bit of maths. I haven't tested it, but it should theoretically work (assuming frame #2 is horizontally right after #1): none
    [JellyAnimationSet] 
    Texture           = jelly.png
    KeyDuration       = 0.1
    FrameSize         = (32, 32, 0)
    JellyWobbleAnim   = 4
    StartAnim         = JellyWobbleAnim
    JellyWobbleAnim-> = JellyWobbleAnim
    Pivot             = center
    
    [JellyWobbleAnim0004]
    TextureOrigin     = (32, 0, 0)
    
  • edited June 2017
    Ah yes, the second looks better and is probably the more correct way to go for a single extra frame. I'll try that.
  • edited June 2017
    One thing worth noting: setting TextureOrigin value like this "resets" the automatic frame processor. Which means if you were to set
    JellyWobbleAnim = 5
    

    You'd end up with this sequence of frames: [1] [2] [3] [2] [3] and *not* [1] [2] [3] [2] [4] or [1] [2] [3] [2] [5].
  • edited June 2017
    I did a quick test and it looked like it was working for me.
    Nice wobbly animation by the way! =)
  • edited June 2017
    Yep it all works perfectly for me. I'd forgotten about that framing syntax. The new anim tutorial doesn't cover it as it's not appropriate, but this will probably go into an example on the wiki.
Sign In or Register to comment.