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.
- Create a new event "jump-event".
- In setup mode, set some event data like { int: 1, float: 0.1, string: "1" }.
- In animation mode, select some animation key frame.
- Set the event data to { int: 1, float: 0.1, string: "1" } and Key the event.
- 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.