本文整理汇总了C++中TileMap::copyCellAt方法的典型用法代码示例。如果您正苦于以下问题:C++ TileMap::copyCellAt方法的具体用法?C++ TileMap::copyCellAt怎么用?C++ TileMap::copyCellAt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TileMap
的用法示例。
在下文中一共展示了TileMap::copyCellAt方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AnimatedCollideableSprite
CharacterClone::CharacterClone(int width, int height, std::vector<State> stateStack, b2Body* body, QGraphicsItem *parent) :
AnimatedCollideableSprite(width, height, body, parent)
{
this->setZValue(1);
this->setSolid(true);
TileMap * playerTiles = new TileMap(32, 32, 0, 0, "./resources/sprites/mainCharClone.png");
std::vector<QPixmap> standRight;
standRight.push_back(playerTiles->copyCellAt(0, 0));
std::vector<QPixmap> standLeft;
standLeft.push_back(playerTiles->copyCellAt(4, 0));
std::vector<QPixmap> walkRight;
walkRight.push_back(playerTiles->copyCellAt(0, 0));
walkRight.push_back(playerTiles->copyCellAt(1, 0));
walkRight.push_back(playerTiles->copyCellAt(2, 0));
walkRight.push_back(playerTiles->copyCellAt(3, 0));
std::vector<QPixmap> walkLeft;
walkLeft.push_back(playerTiles->copyCellAt(7, 0));
walkLeft.push_back(playerTiles->copyCellAt(6, 0));
walkLeft.push_back(playerTiles->copyCellAt(5, 0));
walkLeft.push_back(playerTiles->copyCellAt(4, 0));
std::vector<QPixmap> runRight;
runRight.push_back(playerTiles->copyCellAt(0, 1));
runRight.push_back(playerTiles->copyCellAt(1, 1));
runRight.push_back(playerTiles->copyCellAt(2, 1));
std::vector<QPixmap> runLeft;
runLeft.push_back(playerTiles->copyCellAt(5, 1));
runLeft.push_back(playerTiles->copyCellAt(4, 1));
runLeft.push_back(playerTiles->copyCellAt(3, 1));
std::vector<QPixmap> jumpRight;
jumpRight.push_back(playerTiles->copyCellAt(0, 2));
jumpRight.push_back(playerTiles->copyCellAt(1, 2));
jumpRight.push_back(playerTiles->copyCellAt(2, 2));
std::vector<QPixmap> jumpLeft;
jumpLeft.push_back(playerTiles->copyCellAt(5, 2));
jumpLeft.push_back(playerTiles->copyCellAt(4, 2));
jumpLeft.push_back(playerTiles->copyCellAt(3, 2));
std::vector<QPixmap> climb;
climb.push_back(playerTiles->copyCellAt(0, 3));
climb.push_back(playerTiles->copyCellAt(1, 3));
this->addAnimation(standRight, Loop);
this->addAnimation(standLeft, Loop);
this->addAnimation(walkRight, Loop);
this->addAnimation(walkLeft, Loop);
this->addAnimation(runRight, Loop);
this->addAnimation(runLeft, Loop);
this->addAnimation(jumpRight, Forward);
this->addAnimation(jumpLeft, Forward);
this->addAnimation(climb, Loop);
this->triggerAnimation(Stand_Right);
m_stateStack = stateStack;
}