geronimox

I found something that i believe is not the expected behavior...

Could be a bug when exporting json, or a bug when reading skeleton animation data.

1. Create a new event "jump-event".
2. In setup mode, set some event data like { int: 1, float: 0.1, string: "1" }.
3. In animation mode, select some animation key frame.
4. Set the event data to { int: 1, float: 0.1, string: "1" } and Key the event.
5. Export .json, minimal, pretty

We get the following export, where event data is ommited when Keyed to the jump animation, because it has the same data as the default data of the event.
{
events: {
jump-event: { int: 1, float: 0.1, string: "1" }
},
animations: {
jump: {
events: [
{ time: 0.2333, name: jump-event },
]
},
}
}
But on the libgdx runtime "SkeletonJson.readAnimation()", when the event is created and set on the timeline, its data attribute is wrong (?) as it was not filled with "jsonroot.events.jump-event" data.

May be i did not get the way that Events should be used, but i would expect the event parameter of AnimationStateListener.event(Event event) to have the default event information on
event.getInt(), event.getFloat(), event.getString()
and the keyframe overriden (or default if not set) data on
event.getData().getInt(), event.getData().getFloat(), event.getData().getString().

I hope i made my point.

Gero.
Аватара пользователя
geronimox
  • Сообщения: 2

Nate

Other way around: Event has the keyframe data, EventData has the setup pose data.
Аватара пользователя
Nate

Nate
  • Сообщения: 9288

geronimox

My bad, i could not get the events to be fired, so i made wrong conclusions from the libgdx spine runtime source.

Thanks Nate!
-
Gero.
Аватара пользователя
geronimox
  • Сообщения: 2


Вернуться в Bugs