Forums » C++ Framework » CCParticleSystemQuad position not correct »
| Chad Grenier | CCParticleSystemQuad position not correct | ||||
|---|---|---|---|---|---|
|
Added by Chad Grenier about 1 year ago
I made an effect with Particle Designer and saved it as a plist file. Loaded it into my cocos2d-x project but it does not match what I see in Particle Designer. The effect is slightly different looking, and the position of the effect does not match. If I place the emitter at 0,0 the effect actually goes to something like -10, 10. CCParticleSystem emitter = new CCParticleSystemQuad(); emitter->initWithFile( "fx_aura.plist" ); emitter->autorelease(); emitter->setPosition( ccp( 0.0f, 0.0f ) ); this->addChild( emitter, 1 ); |
||||
| Brandon Dorris | RE: CCParticleSystemQuad position not correct | ||||
|
Added by Brandon Dorris 11 months ago
I'm seeing the same thing. It's generally ok with smaller textures, but larger ones seem to exacerbate the issue. I've tried moving the emitter to the right and down based on the texture size. This works for some effects and devices, but not others. I'm trying to locate the issue and will post another reply if I figure it out. Chad, if you were able to figure out a fix for this, could you share it? |
||||
| Chad Grenier | RE: CCParticleSystemQuad position not correct | ||||
|
Added by Chad Grenier 11 months ago
I have not looked for a fix yet. I just stopped doing particles in my project for now and plan to revisit it later. Please do post your fix if you find one, as I'll do the same. |
||||
| Brandon Dorris | RE: CCParticleSystemQuad position not correct | ||||
|
Added by Brandon Dorris 11 months ago
If anyone else has any input on this, it would be appreciated. I've spent most of my day trying to figure out what's going on. Here are some things I've tried: Moving the position of the emitter down and to the right based on the default size of the texture. The part that is bugging me the most is that, depending on the device, the fixes mentioned above sometimes help and sometimes do not. An iPhone 4/4S will emit the particles from a point well beyond the texture width/height up and to the left. An iPad 2 will emit from the exact point I am trying to compensate for (it works). |
||||
| Matthew Miller | RE: CCParticleSystemQuad position not correct | ||||
|
Added by Matthew Miller 11 months ago
Remember that the iPad and iPhone have different window sizes, and particles systems, just like textures, do not scale up automatically. -- |
||||
| Brandon Dorris | RE: CCParticleSystemQuad position not correct | ||||
|
Added by Brandon Dorris 11 months ago
Thanks for your input Matthew. I actually ended up making a couple test projects to figure out what was going on. Project 1: Project 2: So, rather than try to figure out the problem with my project in cocos2d-1.0.1-x-0.13, I just converted my project to use 2.0.1. I am very happy with the results. |
(1-5/5)