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:

  1. First class is the first screen. Fade animation works on the company's logo.
  2. Second class is the second screen. Fade animation for the loading screen works.
  3. 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.

        public void onEvent(int arg0, BaseTween<?> arg1)


    Tween // --> This is where I focused the problem.
    .to(black_Sprite, Tween_Animation.ALPHA, 3f)
    .repeatYoyo(200, 2.5f) // --> I set the repeat for 200 times when I noticed that the animation won't work!

I solved it! I forgot to add this code at the render() method:

Tween_Manager.update(delta); // --> Set update to enable animation changes.
  • 1
    \$\begingroup\$ yeah, that'll do it. shows how much a noob i am at this that I didn't see that. \$\endgroup\$ – LoveMeSomeCode Jan 5 '13 at 3:42
  • 1
    \$\begingroup\$ We all missed, confused, puzzled, or even often forgot the most simple solution and makes the program to cause a collateral haywire. \$\endgroup\$ – David Dimalanta Jan 11 '13 at 5:03

I've had issues with the Tween library and I usually find I have to eliminate variables and until it works and then add them back in.

Some things to try:

Did the animation work before you added repeatYoyo?

Did you mean to set the Alpha to 3? Usually this ranges from 0 to 1.

Did you try it without any easing?

Good Luck!

  • \$\begingroup\$ I tried the rest of the three but still nothing works. But anyways, thank you. \$\endgroup\$ – David Dimalanta Jan 4 '13 at 2:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.