Tween Animation Cannot Start
- by David Dimalanta
Do you have any reasons why my tween code didn't run or work? I already add the tween engine onto the library folder under LibGDX project folder and "Order and Export" it under Java Build Path at the Properties menu. My first two classes ran correctly and workly but my third class didn't work. Here's the sequence:
First class is the first screen. Fade animation works on the company's logo.
Second class is the second screen. Fade animation for the loading screen works.
Third class is the third screen. After the second screen, now calls for the third screen. Animation stopped or won't run since I want the black screen to fade out at the start when the menu is here.
Can you check if I did right? Look carefully by comment lines for explanation.
//-----[ Animation Setup ]-----
Tween.registerAccessor(Sprite.class, new Tween_Animation()); // --> Tween_Animation.java
Tween_Manager = new TweenManager(); // --> I initialized it the TweenManager and seems okay.
cb_start = new TweenCallback() // --> I'll use this when I choose START and the menu will fade in black.
{
@Override
public void onEvent(int arg0, BaseTween<?> arg1)
{
goTo();
}
};
Tween // --> This is where I focused the problem.
.to(black_Sprite, Tween_Animation.ALPHA, 3f)
.target(1)
.ease(TweenEquations.easeInQuad)
.repeatYoyo(200, 2.5f) // --> I set the repeat for 200 times when I noticed that the animation won't work!
.start(Tween_Manager);