Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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);
share|improve this question

2 Answers 2

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!

share|improve this answer
    
I tried the rest of the three but still nothing works. But anyways, thank you. –  David Dimalanta Jan 4 '13 at 2:22
up vote 2 down vote accepted

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

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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