mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-05 06:44:56 +08:00
Added event toasts to Skeleton Viewer.
This commit is contained in:
parent
cc4f19da98
commit
c278cf77fb
@ -76,6 +76,7 @@ import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener;
|
||||
import com.badlogic.gdx.scenes.scene2d.utils.ClickListener;
|
||||
import com.badlogic.gdx.utils.Array;
|
||||
import com.badlogic.gdx.utils.viewport.ScreenViewport;
|
||||
import com.esotericsoftware.spine.AnimationState.AnimationStateAdapter;
|
||||
import com.esotericsoftware.spine.AnimationState.TrackEntry;
|
||||
|
||||
public class SkeletonViewer extends ApplicationAdapter {
|
||||
@ -172,6 +173,11 @@ public class SkeletonViewer extends ApplicationAdapter {
|
||||
skeleton.updateWorldTransform();
|
||||
|
||||
state = new AnimationState(new AnimationStateData(skeletonData));
|
||||
state.addListener(new AnimationStateAdapter() {
|
||||
public void event (TrackEntry entry, Event event) {
|
||||
ui.toast(event.getData().getName());
|
||||
}
|
||||
});
|
||||
|
||||
this.skeletonFile = skeletonFile;
|
||||
Preferences prefs = Gdx.app.getPreferences("spine-skeletonviewer");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user