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 8730945
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:07:32+00:00 2026-06-13T09:07:32+00:00

I made two sets of spritesheets using TexturePacker , one is called objects-0.plist /

  • 0

I made two sets of spritesheets using TexturePacker, one is called objects-0.plist/objects0-png and objects-0-ipad.plist/objects-0-ipad.png. Each of them has the following images in it:

// objects-0.plist / objects-0.png
object-0-0.png : 50x50 PNG file
object-0-1.png : 50x50 PNG file
object-0-2.png : 50x50 PNG file

// objects-0-ipad.plist / objects-0-ipad.png
object-0-0-ipad.png : 100x100 PNG file
object-0-1-ipad.png : 100x100 PNG file
object-0-2-ipad.png : 100x100 PNG file

I’ve loaded these up in the CCSpriteFrameCache like so:

bool AnimTest::init( ) {
    if ( !CCLayer::init( ) ) return false;

    CCSpriteFrameCache::sharedSpriteFrameCache( ) -> addSpriteFrameWithFile( "objects-0.plist" );
}

Then, I tried making a CCSprite object using one of the files in the .plist file.

bool AnimTest::init( ) {
    if ( !CCLayer::init( ) ) return false;

    CCSpriteFrameCache::sharedSpriteFrameCache( ) -> addSpriteFrameWithFile( "objects-0.plist" );

    CCSprite * testSprite = CCSprite::createWithSpriteFrameName( "object-0-0.png" );
    this -> addChild( testSprite );

    return true;
}

If I run this one from an iPod/iPhone, it works fine. However, if I run this from an iPad, CCSprite::createWithSpriteFrameName( ) throws an assert saying the file name is invalid.

However, if I explicitly use the files with the -ipad suffix, it works fine with no errors, which it should.

bool AnimTest::init( ) {
    if ( !CCLayer::init( ) ) return false;

    CCSpriteFrameCache::sharedSpriteFrameCache( ) -> addSpriteFrameWithFile( "objects-0-ipad.plist" );

    CCSprite * testSprite = CCSprite::createWithSpriteFrameName( "object-0-0-ipad.png" );
    this -> addChild( testSprite );

    return true;
}

How can I fix this? Any help is appreciated.

  • 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-06-13T09:07:34+00:00Added an answer on June 13, 2026 at 9:07 am

    Thought of an idea while writing the question which I only tested when it was sent and it worked.

    The problem is that I’m retrieving the Sprite Frame directly from the file name. Meaning, I’m retrieving objects-0-0.png and cocos2d-x does not automatically use the suffixed version. So, knowing that, I re-made/re-wrote the .plist file so that the two files (one with and one without suffix) have the same image file names, but are totally different images. The .plist files and the .png spritesheets are left with the suffixes.

    Instead of:

    // objects-0.plist / objects-0.png
    object-0-0.png : 50x50 PNG file
    object-0-1.png : 50x50 PNG file
    object-0-2.png : 50x50 PNG file
    
    // objects-0-ipad.plist / objects-0-ipad.png
    object-0-0-ipad.png : 100x100 PNG file
    object-0-1-ipad.png : 100x100 PNG file
    object-0-2-ipad.png : 100x100 PNG file
    

    Rename all the files inside the .plist into those that don’t use the suffix.

    // objects-0.plist / objects-0.png
    object-0-0.png : 50x50 PNG file
    object-0-1.png : 50x50 PNG file
    object-0-2.png : 50x50 PNG file
    
    // objects-0-ipad.plist / objects-0-ipad.png
    object-0-0.png : 100x100 PNG file
    object-0-1.png : 100x100 PNG file
    object-0-2.png : 100x100 PNG file
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I made two applications that each one of them is tabbar based. Now I
I made two classes in which one is main and other one is a
I made two different Fibonacci functions, the first one worked perfectly. Then I tried
I have two objects a user and a role which I make persistant using
I have two sets of web applications, one set running under Asp.Net 3.5 and
Recently i made two template classes,according to the book Modern C++ design. I think
I've created a simple webapp with user authentication. I've made two models: Users for
Context: .Net, C# I want to print a complex number made from two doubles.
Our application is currently made up of two big entities: C# ASPX files, and
I'm putting together a simple test made up of two tutorials available online for

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.