Orx - Portable Game Engine
Welcome, Guest
Please Login or Register.    Lost Password?
Unusual sprite sheet usage for new animation syste
(1 viewing) 1 Guest
Go to bottom
TOPIC: Unusual sprite sheet usage for new animation syste
#8727
sausage
Moderator
Posts: 719
graphgraph
User Offline Click here to see the profile of this user
Gender: Male sausagejohnson http://waynejohnson.net Location: Near Canberra, Australia
Unusual sprite sheet usage for new animation syste 5 Months, 1 Week ago Karma: 3
In the case of a sprite sheet like in the beginners tutorial here:

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

The simple animation would be just:


Code:

[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] ?
 
Logged Logged
 
Indie gamedev with Orx at night. Always feel free to come and say hi over in gitter.im/orx/orx gitter chat or drop me a message.
  The administrator has disabled public write access.
#8728
iarwain
Administrator
Posts: 3125
graph
User Offline Click here to see the profile of this user
Gender: Male Orx - Portable Game Engine Location: Montreal
Re:Unusual sprite sheet usage for new animation syste 5 Months, 1 Week ago Karma: 71
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):


Code:


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

[JellyWobbleAnim0004]
TextureOrigin     = (32, 0, 0)

 
Logged Logged
 
Last Edit: 2017/06/14 06:18 By iarwain.
 
Want to follow orx's development? Check our Trello board: http://trello.com/b/g4jMS6jc/orx-tasks
  The administrator has disabled public write access.
#8729
sausage
Moderator
Posts: 719
graphgraph
User Offline Click here to see the profile of this user
Gender: Male sausagejohnson http://waynejohnson.net Location: Near Canberra, Australia
Re:Unusual sprite sheet usage for new animation syste 5 Months, 1 Week ago Karma: 3
Ah yes, the second looks better and is probably the more correct way to go for a single extra frame. I'll try that.
 
Logged Logged
 
Indie gamedev with Orx at night. Always feel free to come and say hi over in gitter.im/orx/orx gitter chat or drop me a message.
  The administrator has disabled public write access.
#8730
iarwain
Administrator
Posts: 3125
graph
User Offline Click here to see the profile of this user
Gender: Male Orx - Portable Game Engine Location: Montreal
Re:Unusual sprite sheet usage for new animation syste 5 Months, 1 Week ago Karma: 71
One thing worth noting: setting TextureOrigin value like this "resets" the automatic frame processor. Which means if you were to set
Code:


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].
 
Logged Logged
 
Last Edit: 2017/06/14 02:16 By iarwain.
 
Want to follow orx's development? Check our Trello board: http://trello.com/b/g4jMS6jc/orx-tasks
  The administrator has disabled public write access.
#8731
iarwain
Administrator
Posts: 3125
graph
User Offline Click here to see the profile of this user
Gender: Male Orx - Portable Game Engine Location: Montreal
Re:Unusual sprite sheet usage for new animation syste 5 Months, 1 Week ago Karma: 71
I did a quick test and it looked like it was working for me.
Nice wobbly animation by the way! =)
 
Logged Logged
 
Want to follow orx's development? Check our Trello board: http://trello.com/b/g4jMS6jc/orx-tasks
  The administrator has disabled public write access.
#8732
sausage
Moderator
Posts: 719
graphgraph
User Offline Click here to see the profile of this user
Gender: Male sausagejohnson http://waynejohnson.net Location: Near Canberra, Australia
Re:Unusual sprite sheet usage for new animation syste 5 Months, 1 Week ago Karma: 3
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.
 
Logged Logged
 
Indie gamedev with Orx at night. Always feel free to come and say hi over in gitter.im/orx/orx gitter chat or drop me a message.
  The administrator has disabled public write access.
Go to top