Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sprite.setFrame problem #15

Closed
GoogleCodeExporter opened this issue Apr 18, 2016 · 4 comments
Closed

sprite.setFrame problem #15

GoogleCodeExporter opened this issue Apr 18, 2016 · 4 comments

Comments

@GoogleCodeExporter
Copy link

I have a sub sprite extends AngleSprite, and override step function to perform 
animation like this:

    public void step(float secondsElapsed)
    {
        if(frame == roLayout.roFrameCount)
        {
            frame = 0;
        }
        setFrame(frame++);
        super.step(secondsElapsed);
    }

it works well for a short while, but then after a while my sprite disappears 
unexpectedly, I print the mAlpha in Logcat, it always equals 1.
And I'm sure my frame doesn't overstep roFrameCount.

Get confused why my sprite invisible suddenly


Original issue reported on code.google.com by rayjun...@gmail.com on 10 Sep 2010 at 6:05

@GoogleCodeExporter
Copy link
Author

There isn't any reason for that.
Your code is simple. An infinite unsynchronized animation loop.
If you are sure your object will don't have any children object you can not 
call super.step

Can you reproduce this issue always?

Original comment by ipaju...@gmail.com on 16 Sep 2010 at 8:20

  • Added labels: Priority-Low
  • Removed labels: Priority-Medium

@GoogleCodeExporter
Copy link
Author

yeah, always. I only modify Tutorial02 to add a new animate sprite, see attach

Original comment by rayjun...@gmail.com on 19 Sep 2010 at 12:47

Attachments:

@GoogleCodeExporter
Copy link
Author

I noticed your texture's dimension isn't power of 2.

On my hero, I can't load textures that aren't power of 2. Maybe your device can 
render these textures but fail after a while.

Try to use power of 2 compatible textures. With the attached texture, your 
sample run fine forever on my hero.

Original comment by ipaju...@gmail.com on 19 Sep 2010 at 9:15

  • Changed state: Fixed

Attachments:

@GoogleCodeExporter
Copy link
Author

However, I use another Engine:Rokon, can show picture which isn't power of 2, 
so maybe Angle should fix some code to satisfy all pictures

Original comment by rayjun...@gmail.com on 29 Sep 2010 at 1:43

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant