1
\$\begingroup\$

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.
    {

        @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);
\$\endgroup\$

2 Answers 2

2
\$\begingroup\$

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

Tween_Manager.update(delta); // --> Set update to enable animation changes.
\$\endgroup\$
2
  • 1
    \$\begingroup\$ yeah, that'll do it. shows how much a noob i am at this that I didn't see that. \$\endgroup\$ Commented Jan 5, 2013 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\$ Commented Jan 11, 2013 at 5:03
1
\$\begingroup\$

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!

\$\endgroup\$
1
  • \$\begingroup\$ I tried the rest of the three but still nothing works. But anyways, thank you. \$\endgroup\$ Commented Jan 4, 2013 at 2:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .