I’m having a problem with overloading draw() method from CCLayer,
CCSprite and CCTexture2D. I hope someone could help me.
The main problem is that the Texture doesn’t move, it’s remain static in screen, at
point (0,0) but i don’t understand why.
some related code:
//i'm caching the textures
m_Tex1 = CCTextureCache::sharedTextureCache()->addImage("spr1.png");
m_Tex2 = CCTextureCache::sharedTextureCache()->addImage("spr2.png");
m_Tex3 = CCTextureCache::sharedTextureCache()->addImage("spr3.png");
CCSprite* spr1 = CCSprite::createWithTexture(m_Tex1);
//here i put static positions, but the sprites are moved constantly
spr1->setPosition( ccp(100, 200) );
//but the texture(s) are in position (0,0).!! :(
//the spr1->getPosition().x reports moving.
I missed some code for draw?.
what’s the problem with my code?
thanks to everyone.