本文整理汇总了C++中Anim::getOffset方法的典型用法代码示例。如果您正苦于以下问题:C++ Anim::getOffset方法的具体用法?C++ Anim::getOffset怎么用?C++ Anim::getOffset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Anim
的用法示例。
在下文中一共展示了Anim::getOffset方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: draw
/**
* Draw episode 1 guardian.
*
* @param ticks Time
* @param change Time since last iteration
*/
void MedGuardian::draw(unsigned int ticks, int change) {
Anim *stageAnim;
unsigned char frame;
if (next) next->draw(ticks, change);
fixed xChange = getDrawX(change);
fixed yChange = getDrawY(change);
frame = ticks / (set->animSpeed << 5);
if (stage == 0)
stageAnim = anim;
else
stageAnim = level->getAnim(set->anims[E_LFINISHANIM | (animType & 1)] & 0x7F);
stageAnim->setFrame(frame + gridX + gridY, true);
if (ticks < flashTime) stageAnim->flashPalette(0);
drawnX = x + anim->getXOffset();
drawnY = y + anim->getYOffset() + stageAnim->getOffset();
stageAnim->draw(xChange, yChange);
if (ticks < flashTime) stageAnim->restorePalette();
return;
}
示例2: draw
/**
* Draw current frame.
*
* @param x X-coordinate at which to draw
* @param y Y-coordinate at which to draw
*/
void Anim::draw (fixed x, fixed y, int accessories) {
Anim* anim;
sprites[frame]->draw(
FTOI(x) + (xOffsets[frame] << 2),
FTOI(y) + yOffsets[frame] - yOffset);
if (accessories && accessory) {
anim = level->getAnim(accessory);
anim->setFrame(frame, true);
anim->draw(
x + ITOF(accessoryX << 2),
y + ITOF(accessoryY - yOffset) - anim->getOffset(),
accessories - 1);
}
return;
}