本文整理汇总了C++中Armature::getDisplay方法的典型用法代码示例。如果您正苦于以下问题:C++ Armature::getDisplay方法的具体用法?C++ Armature::getDisplay怎么用?C++ Armature::getDisplay使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Armature
的用法示例。
在下文中一共展示了Armature::getDisplay方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: update
void Slot::update() {
DBObject::update();
if(_isDisplayOnStage)
{
Armature* child = this->getChildArmature();
if(parent->_tweenPivot)
{
float pivotX = parent->_tweenPivot->x;
float pivotY = parent->_tweenPivot->y;
if(parent)
{
glm::mat4 parentMatrix = parent->_globalTransformMatrix;
_globalTransformMatrix[3][0] += parentMatrix[0][0] * pivotX + parentMatrix[1][0] * pivotY;
_globalTransformMatrix[3][1] += parentMatrix[0][1] * pivotX + parentMatrix[1][1] * pivotY;
}
}
_displayBridge->updateTransform(this->_globalTransformMatrix, this->global);
if(child)
{
child->getDisplay()->setTransformationMatrix(this->_globalTransformMatrix);
}
}
}
示例2: getDisplay
Object* Slot::getDisplay() {
Object* display = displayList[_displayIndex];
if(checkIfClass<Armature>(display))
{
Armature* d = (Armature*) display;
return (Object*)d->getDisplay();
}
return display;
}
示例3: changeDisplay
void Slot::changeDisplay(int displayIndex) {
if(displayIndex < 0)
{
if(!_isHideDisplay)
{
_isHideDisplay = true;
_displayBridge->removeDisplay();
}
}
else
{
if(_isHideDisplay)
{
_isHideDisplay = false;
if(this->_armature)
{
int in = this->_armature->getSlotIndexOf(this);
if(in > -1) {
_displayBridge->addDisplay(this->_armature->getDisplay(), in);
this->_armature->_slotsZOrderChanged = true;
}
}
}
int length = displayList.size();
if(displayIndex >= length && length > 0)
{
displayIndex = length - 1;
}
if(_displayIndex != displayIndex)
{
_displayIndex = displayIndex;
Object* content = displayList[_displayIndex];
if(checkIfClass<Armature>(content))
{
Armature* contentArmature = (Armature*) content;
_displayBridge->setDisplay((Object*)(contentArmature->getDisplay()));
}
else
{
_displayBridge->setDisplay(content);
}
if(_displayDataList.size() > 0 && _displayIndex <= _displayDataList.size())
{
this->origin->copy(_displayDataList[_displayIndex]->transform);
}
}
}
if(!_isHideDisplay && _displayBridge->getDisplay())
{
if(!_isDisplayOnStage)
{
_isDisplayOnStage = true;
if(getChildArmature())
{
getChildArmature()->getAnimation()->play();
}
}
}
else if(_isDisplayOnStage)
{
_isDisplayOnStage = false;
if(getChildArmature())
{
getChildArmature()->getAnimation()->stop();
getChildArmature()->getAnimation()->_lastAnimationState = 0;
}
}
}
示例4: init
// on "init" you need to initialize your instance
bool HelloWorld::init()
{
bool bRet = false;
do
{
//////////////////////////////////////////////////////////////////////////
// super init first
//////////////////////////////////////////////////////////////////////////
CC_BREAK_IF(! CCLayerColor::initWithColor(ccc4(200, 200, 200, 255)));
// CC_BREAK_IF(! CCLayerColor::initWithColor(ccc4(0, 0, 0, 255)));
CCSize size = CCDirector::sharedDirector()->getWinSize();
weaponIndex = 0;
BatchNodeManager::sharedBatchNodeManager()->initWithLayer(this, "TEST_ARMATURE");
ArmatureDataManager::sharedArmatureDataManager()->addArmatureFileInfo("Zombie_f/Zombie", "", "zombie.png", "zombie.plist", "zombie.xml");
ArmatureDataManager::sharedArmatureDataManager()->addArmatureFileInfo("Knight_f/Knight", "", "knight.png", "knight.plist", "knight.xml");
ArmatureDataManager::sharedArmatureDataManager()->addArmatureFileInfo("cyborg", "", "cyborg.png", "cyborg.plist", "cyborg.xml");
// if the png, plist, xml is same, you can use param _useExistFileInfo
ArmatureDataManager::sharedArmatureDataManager()->addArmatureFileInfo("armInside", "cyborg", "", "", "");
ArmatureDataManager::sharedArmatureDataManager()->addArmatureFileInfo("armOutside", "cyborg", "", "", "");
ArmatureDataManager::sharedArmatureDataManager()->addArmatureFileInfo("circle_in_circle_stage3", "", "loading.png", "loading.plist", "loading.xml");
ArmatureDataManager::sharedArmatureDataManager()->addArmatureFileInfo("Cattail", "", "Cattail.png", "Cattail.plist", "Cattail.xml");
ArmatureDataManager::sharedArmatureDataManager()->addArmatureFileInfo("Zombie_ladder", "", "zombie_ladder.png", "zombie_ladder.plist", "zombie_ladder.xml");
ArmatureDataManager::sharedArmatureDataManager()->addArmatureFileInfo("Zombie_ladder", "", "zombie_ladder.png", "zombie_ladder.plist", "zombie_ladder.xml");
ArmatureDataManager::sharedArmatureDataManager()->addArmatureFileInfo("bird", "", "bird.png", "bird.plist", "bird.xml");
ArmatureDataManager::sharedArmatureDataManager()->addArmatureFileInfo("weapon", "", "weapon.png", "weapon.plist", "weapon.xml");
armatures = new CCArray();
Armature *armature = NULL;
//! use BATCHNODE_VERTEXZ you can change display in different batchnode
BatchNodeManager::sharedBatchNodeManager()->getBatchNode("knight.png")->setRenderType(BATCHNODE_VERTEXZ);
BatchNodeManager::sharedBatchNodeManager()->getBatchNode("cyborg.png")->setRenderType(BATCHNODE_VERTEXZ);
BatchNodeManager::sharedBatchNodeManager()->getBatchNode("zombie.png")->setRenderType(BATCHNODE_VERTEXZ);
armature = Armature::create("cyborg");
armature->getAnimation()->play("run");
armature->getDisplay()->setPosition(ccp(size.width/2 + 130, size.height/2));
armature->setZOrder(2);
armature->setAnimationCallback(this);
armatures->addObject(armature);
armature = Armature::create("Zombie_f/Zombie");
armature->getAnimation()->play("run");
armature->getDisplay()->setPosition(ccp(size.width/2 + 100, size.height/2));
armature->setZOrder(1);
armatures->addObject(armature);
armature = Armature::create("Knight_f/Knight");
armature->getAnimation()->play("run");
armature->getDisplay()->setPosition(ccp(size.width/2 + 50, size.height/2));
armatures->addObject(armature);
armature = Armature::create("Knight_f/Knight");
armature->getAnimation()->play("run");
armature->getDisplay()->setPosition(ccp(size.width/2 - 150, size.height/2));
armature->getBone("weapon")->addSpriteDisplay("weapon_f-sword2.png", "weapon.png", 0);
armatures->addObject(armature);
// armature = Armature::create("circle_in_circle_stage3");
// armature->getAnimation()->play("loading");
// armature->getDisplay()->setPosition(ccp(size.width/2, size.height/2));
// armatures->addObject(armature);
armature = Armature::create("Cattail");
armature->getAnimation()->play("anim_shooting");
armature->getDisplay()->setPosition(ccp(size.width/2 + 50, size.height/2 - 100));
armatures->addObject(armature);
armature = Armature::create("Zombie_ladder");
armature->getAnimation()->play("anim_placeladder", 0, 50, 1, TWEEN_EASING_MAX);
armature->getAnimation()->setAnimationScale(3);
armature->getDisplay()->setPosition(ccp(size.width/2 - 230, size.height/2 -100));
armatures->addObject(armature);
armature = Armature::create("bird");
armature->getAnimation()->play("changeColor");
armature->getDisplay()->setPosition(ccp(size.width/2 - 230, size.height/2 + 100));
armatures->addObject(armature);
// for (int i = 0; i<500; i++)
// {
// Armature *armature = Armature::create("Knight_f/Knight");
//.........这里部分代码省略.........