注意:此动作并不在乎CCNode对象的其他属性。也就是说无论CCNode对象是否可见,此动作都会执行。
Demo
void ActionPlace::randomPlace(float dt){ CCSize s = CCDirector::sharedDirector->getWinSize(); CCPoint p = ccp(CCRANDOM_0_1() * s.width, CCRANDOM_0_1 * s.height); CCActionInstant *actionPlace = CCPlace::create(p); m_node->runAction(actionPlace); }