ClassCastException in Animation.getKeyFrames()
See original GitHub issueIssue details
Affected calss com.badlogic.gdx.graphics.g2d.Animation
code:
Animation<TextureRegion> animation = new Animation<TextureRegion>(...);
TextureRegion[] f = animation.getKeyFrames();
cause:
Exception in thread “LWJGL Application” java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Lcom.badlogic.gdx.graphics.g2d.TextureRegion;
this code:
Object[] f = animation.getKeyFrames();
does not throw exceptions
Version of LibGDX and/or relevant dependencies
LibGDX v1.9.5
Please select the affected platforms
- Android
- iOS (robovm)
- iOS (MOE)
- HTML/GWT
- Windows
- Linux
- MacOS
Issue Analytics
- State:
- Created 7 years ago
- Comments:11 (8 by maintainers)
Top Results From Across the Web
Developers - ClassCastException in Animation.getKeyFrames() -
Issue details. Affected calss com.badlogic.gdx.graphics.g2d.Animation. code: Animation<TextureRegion> animation = new Animation<TextureRegion>(...);
Read more >Strange java.lang.ClassCastException when using [] call
If i change it to get() error disappears. tex = animation.keyFrames.get(0). Here is full method. I simplified example.
Read more >Strange java.lang.ClassCastException when using [] call-kotlin
This is interesting! Decompiling val tex1 = animation.keyFrames.get(0). gives. ALOAD 2 INVOKEVIRTUAL com/badlogic/gdx/graphics/g2d/Animation.getKeyFrames ...
Read more >javafx.animation.Timeline.getKeyFrames java code examples
public static void hackTooltipStartTiming(Tooltip tooltip) { try { Field fieldBehavior = tooltip.getClass().getDeclaredField("BEHAVIOR"); fieldBehavior.
Read more >core/java/android/animation/PropertyValuesHolder.java - platform ...
derived when the animation starts in setupSetterAndGetter() if using ObjectAnimator. ... setupValue(target, keyframes.get(keyframes.size() - 1));. }.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I get the same exception with libGDX 19.6 .
@samboadas221 This has already been fixed. Read the javadoc of the constructors carefully.