Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7030537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:41:01+00:00 2026-05-28T00:41:01+00:00

I am working on Wi-Engine and currently facing the issue while loading two sheets

  • 0

I am working on Wi-Engine and currently facing the issue while loading two sheets into zwoptex manager.

In the code below I am loading two sheets (sheeta and sheetb), with two animations which are stored as actions in class (firstAction, secondAction). Later when I runAction on the sprite on button click, the firstAction runs fine but the secondAction uses the texture of firstAction with frames of second, which causes unexpected result. kindly if you can let me know what I am missing or doing wrong.

`

/******** Loading Sheet 1********/


Texture2D tex = Texture2D.makePNG(R.drawable.sheeta);
ZwoptexManager.addZwoptex("sheeta", R.raw.sheeta,  tex);


/******** Loading Sheet 2********/


Texture2D tex2 = Texture2D.makePNG(R.drawable.sheetb);
ZwoptexManager.addZwoptex("sheetb",  R.raw.sheetb,tex2);


petSprite = ZwoptexManager.makeSprite("image_1.png"); // image_1 is in Sheeta

/******* Creating Animations and Actions    ******/
Animation firstAnimation = new Animation(0);

for (int i = 1; i <= 9; i++) 
{
    firstAnimation.addFrame(0.1f, ZwoptexManager.getFrameRect("sheeta",             "image_" + i + ".png"));
}


Animate a = (Animate)Animate.make(firstAnimation).autoRelease();
firstAction = (Action)Repeat.make(a, 2);

Animation secondAnimation = new Animation(0);

for (int i = 10; i <= 20; i++) 
{
    secondAnimation.addFrame(0.1f, ZwoptexManager.getFrameRect("sheetb",
                    "image_" + i + ".png"));
}
Animate b = (Animate)Animate.make(secondAnimation).autoRelease();
secondAction = (Action)Repeat.make(b, 1);

`

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T00:41:01+00:00Added an answer on May 28, 2026 at 12:41 am

    The following is the proper way to get animations working, for those who are having the same problem.

    Animation secondAnimation = new Animation(0);
    for (int i = 52; i <= 65; i++) 
    {
        SpriteFrame temp = ZwoptexManager.getSpriteFrame("sheetb","image_" + i + ".png");
        temp.setDuration(0.1f);
        secondAnimation.addFrame(temp);
    }
    Animate temp = (Animate)Animate.make(secondAnimation).autoRelease();
    Action firstAction = (Action)Repeat.make(temp, 1);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently working on implementing a fulltext search engine for one of our sites,
I am currently working on a simple web application through Google App engine using
Alright so here is my issue. I'm working a game engine that will eventually
I'm currently working on a custom UI engine for a game. I've very basic
I am currently working on a game engine that needs to move values between
I'm currently working on a 2D game engine and I've read about auto_ptr's and
I'm currently working on a project using Flask and Google App Engine . Calling
I'm currently working on a small 2D game-engine in C++, but I am now
I'm currently working on a game engine written in pygame and I wanted to
I'm currently working on a small iPhone game, and am porting the 3d engine

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.