convertToNodeSpace不考虑scale的影响
setContentSize只设置内容大小,影响之后的锚点位置,但是不影响绘制效果。超过contentSize的部分继续绘制
setTextureRect(Rect)比前者多了剪裁功能;setTextureRect(CCRectMake(1,2,3,4));
从sprite左上角为起点,x=1,y=2,剪裁width=3,height=4的矩形,作为新的图像建立sprite
关于get:http://www.wosoni.com/wosoniblog/gamecocos2dx/article/details/40423591.html
for (int i = 0; i < enemys->size(); i++){ auto enemy = static_cast <Enemy*>(enemys->at(i)); int armSerial = map->getArmSerialNum(enemy->getPosition()); if (armSerial != 0){ auto arm = static_cast <Arm*>(arms->at(armSerial - 1)); if (enemy->enableDamege(time,arm->getDispersedTime())){ enemy->getEnemyBase()->plusCurrentBlood(arm->getDamage()); } } if (enemy->updataState()){ //deadEnemy.pushBack(enemy); enemys->erase(i); enemy->deadAction(); i--; //每删除一个i-- } }
for (int i = 0,j=0; i < ARMNUM; i++,j++){ _levelArmLimit[i] = levelArmLimit[i]; if (_levelArmLimit[i] == 0){ _listView->removeItem(j); j--; } }原文链接:https://www.f2er.com/cocos2dx/344581.html