本文整理汇总了C++中DrawBuffer::DrawImageRotated方法的典型用法代码示例。如果您正苦于以下问题:C++ DrawBuffer::DrawImageRotated方法的具体用法?C++ DrawBuffer::DrawImageRotated怎么用?C++ DrawBuffer::DrawImageRotated使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DrawBuffer
的用法示例。
在下文中一共展示了DrawBuffer::DrawImageRotated方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: draw
void TouchButton::draw(DrawBuffer &db, uint32_t color, uint32_t colorOverlay)
{
float scale = 1.0f;
if (isDown_) {
color |= 0xFF000000;
colorOverlay |= 0xFF000000;
scale = 2.0f;
}
scale *= scale_;
// We only mirror background
db.DrawImageRotated(imageIndex_, x_ + w_*scale_/2, y_ + h_*scale_/2, scale, rotationAngle_, color, mirror_h_);
if (overlayImageIndex_ != -1)
db.DrawImageRotated(overlayImageIndex_, x_ + w_*scale_/2, y_ + h_*scale_/2, scale, rotationAngle_, colorOverlay);
}
示例2: draw
void TouchCrossPad::draw(DrawBuffer &db, uint32_t color, uint32_t colorOverlay)
{
static const float xoff[4] = {1, 0, -1, 0};
static const float yoff[4] = {0, 1, 0, -1};
static const int dir[4] = {PAD_BUTTON_RIGHT, PAD_BUTTON_DOWN, PAD_BUTTON_LEFT, PAD_BUTTON_UP};
for (int i = 0; i < 4; i++) {
float x = x_ + xoff[i] * scale_ * radius_;
float y = y_ + yoff[i] * scale_ * radius_;
float angle = i * M_PI / 2;
float imgScale = (down_ & dir[i]) ? scale_ * 2 : scale_;
db.DrawImageRotated(arrowIndex_, x, y, imgScale, angle + PI, color, false);
if (overlayIndex_ != -1)
db.DrawImageRotated(overlayIndex_, x, y, imgScale, angle + PI, colorOverlay);
}
}