Quantcast
Channel: Cocos Forums - Latest topics
Viewing all articles
Browse latest Browse all 17083

Change parent of a sprite on OnTouchMoved event of sprite

$
0
0

@rohit wrote:

I want to change the parent of a sprite on onTouchMoved. But when i does it i cant move it now.To get the onTouchMoved event i have to touch it(OnTouchBegan).How can i do that.
On On touchMovedEvent of sprite i have changed the parent as
this->retain();
this->removeFromParentAndCleanup(false);//Previously it is not the child of gameLayer.
gameLayer->addChild(this,kTemporaryItemTag);
this->release();

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 17083

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>