Retina Display and Particle plist

Forums Programming cocos2d support (graphics engine) Retina Display and Particle plist

This topic contains 11 replies, has 6 voices, and was last updated by  richy486 1 year, 5 months ago.

Viewing 12 posts - 1 through 12 (of 12 total)
Author Posts
Author Posts
June 17, 2011 at 1:29 pm #232417

indy2005
@indy2005

Hi,

I cant see any guidance on the wiki on what do do with particles for supporting retina display?

I am getting errors linked to a lack of hd equivalents. Do I have to tweak any parameters in the particle designer…or simply just use a hd version of the particle png file, and leave the particle configuration as it is?

2011-06-17 00:31:54.802xxxx  CCFileUtils: Warning HD file not found: Exhaust_1-hd.plist
2011-06-17 00:31:54.808 xxxx CCFileUtils: Warning HD file not found: Exhaust_1-hd.png

any advice appreciated.

Regards

i

June 17, 2011 at 7:11 pm #334340

indy2005
@indy2005

OK, so I created Exhaust_1-hd.plist and Exhaust_1-hd.png, updated the -hd plist to use the -hd png…and now I get:

Filename(Exhaust_1-hd.png) contains -hd suffix. Removing it. See cocos2d issue #1040

But cant leave it as Exhaust_1.png, as how does that work, when I need an SD and a HD version??

Any help appreciated

i

June 17, 2011 at 7:13 pm #334341

indy2005
@indy2005

wait a minute…perhaps I DO need to create a -hd.png, but shouldn’t adjust the reference in the -hd plist, as when the plist gets read, it will add the -hd into the png!?

June 18, 2011 at 4:02 pm #334342

Appicus
Participant
@kenhru

If you use Particle Designer by 71squared you don’t need to worry about this and you don’t need any -hd extended files. Just choice “cocos2d (plist)” as File Format and check “Embed Texture” on.

June 18, 2011 at 9:40 pm #334343

indy2005
@indy2005

Hi can you explain why I don’t need to deal with hd in particle designer? I’m using this at the moment and on retina my particles are very small and seem too spaced out? Thx

June 18, 2011 at 10:35 pm #334344

Appicus
Participant
@kenhru

I really can’t because I don’t have this this issue… hm, very strange… Which Cocos2d version and Particle Designer version do you use?

July 7, 2011 at 6:17 pm #334345

Appicus
Participant
@kenhru

Ok, I figured it out. Your atlas .png file must have an extension -hd but all images must NOT!

I’ve created two folders, “1x” and “2x” and I copied all normal resolution images into the 1x and retina images into the 2x folder. For example:

1x/hero.png (has dimensions 20x20px)

2x/hero.png (has dimensions 40x40px)

Then I created two atlas files and one of them has a -hd extension:

GameAtlas.zssxml

GameAtlas-hd.zssxml

The size of GameAtlas.zssxml is 1024×1024 and the size of GameAtlas-hd.zssxml is 2048×2048. I then imported all graphics from 1x folder into the GameAtlas.zssxml and all from 2x into the GameAtlas-hd.zssxml.

As export I got these four files:

GameAtlas.plist

GameAtlas.png

GameAtlas-hd.plist

GameAtlas-hd.png

Then you need to copy all these four files into your Resources folder.

You then never use -hd suffix if you are creating a CCSprite.

// Load GameAtlas (Do only once on initialization)
[CCSpriteFrameCache purgeSharedSpriteFrameCache];
[CCTextureCache purgeSharedTextureCache];
CCSpriteFrameCache* frameCache = [CCSpriteFrameCache sharedSpriteFrameCache];
[frameCache addSpriteFramesWithFile:@"GameAtlas.plist"];

// Create a CCSprite (Do each time you need to create a sprite)
CCSprite *heroSprite = [CCSprite spriteWithSpriteFrameName:[NSString stringWithString:@"hero.png"]];

- Kenan.

July 7, 2011 at 6:58 pm #334346

indy2005
@indy2005

Hi,

I have all my atlas files working fine, it’s the arrangement required for particles and Plist files for particle designer. No atlases involved, the particle file is a single texture.

Thx for getting back

I

August 22, 2011 at 8:59 am #334347

Studder
Participant
@studder

Hi indy,

Did you solve this issue since I’m also at a point to support retina and graphics on the iPad and my particles also look ugly. So is this just a matter of using a bigger texture file inside particle designer?

Thanks.

edit: seems to work if you have the -hd texture avalaible.

http://www.71squared.com/community/viewtopic.php?f=22&t=818

August 22, 2011 at 3:18 pm #334348

toadkick
Participant
@toadkick

I chose not to embed the texture in the plist. All I had to do was provide an -hd version of the particle texture and cocos2d load it whenever retina mode is enabled.

January 17, 2012 at 9:27 pm #334349

FBryant
Participant
@fbryant

@toadkick, did you also include .plits with an ‘-hd’ extension? My app says it can’t find HD versions for my .plist’s, I have HD .png’s ofcourse.

November 10, 2012 at 7:56 am #334350

richy486
@richy486

I setup retina particles this way:

When loading particles from .plist files I added:

particle.texture = [[CCTextureCache sharedTextureCache] addImage: @”particle.png”];

after:

CCParticleSystemQuad *particle = [CCParticleSystemQuad particleWithFile:@"particle.plist"];

I have a particle@2x.png (not using -hd for this project but I’m pretty sure that will work too)

I don’t have a particle@2x.plist

Viewing 12 posts - 1 through 12 (of 12 total)

You must be logged in to reply to this topic.