abe azam stop auto animate setPosition on ccsprites
Posts 4
Added by abe azam 11 months ago

EDIT** using cocos2d-x 2.0

i am positioning a bunch of ccsprites in a cclayer

for some reason when i do this it animates them to that location rather than instantly positioning them

i dont want them to animate in ideas on y it is doing this and how to stop it

Jeffrey Walraven RE: stop auto animate setPosition on ccsprites
Posts 27
Location U.S.A.
Added by Jeffrey Walraven 11 months ago

Can you show your code?

abe azam RE: stop auto animate setPosition on ccsprites
Posts 4
Added by abe azam 11 months ago

Jeffrey Walraven wrote:

Can you show your code?

EDIT** using cocos2d-x 2.0

this runs in a ccsprite
@
string start = "bg";
string end = ".png";
string fileName;

CCSprite *tempS;
for(int i = 0; i <4; i++)
{
fileName = start + Utils::num2str(i) + end;
tempS = CCSprite::spriteWithFile(fileName.c_str());
tempS->setAnchorPoint(ccp(0, 0));
tempS->setPosition(ccp(0, tempS->getContentSize().height*(i)));
addChild(tempS);
bg_on.push_back(tempS);
}
@
Jeffrey Walraven RE: stop auto animate setPosition on ccsprites
Posts 27
Location U.S.A.
Added by Jeffrey Walraven 11 months ago

That is weird, because it doesn't do that for me. What is "bg_on"? Are you updated to the latest version of cocos2dx 2.0?

abe azam RE: stop auto animate setPosition on ccsprites
Posts 4
Added by abe azam 11 months ago

Jeffrey Walraven wrote:

That is weird, because it doesn't do that for me. What is "bg_on"? Are you updated to the latest version of cocos2dx 2.0?

its a vector of CCSprites

well i am currently just putting a delay in before it starts.

abe azam RE: stop auto animate setPosition on ccsprites
Posts 4
Added by abe azam 11 months ago

thx for all the help jeff...i just figured it out.

i was transition into the game scene with:

pDirector->pushScene(CCTransitionSlideInB::transitionWithDuration(1.0f, Game::create()));

so it was sliding from the top of the level down to the bottom which made it look like it was the backgrounds that were moving. you could say it was like the perspective of the camera was panning down.

it became obvious once i started to add furniture to the page

DOH!


(1-5/5)