本文整理汇总了C++中Graphic::drawRectBorder方法的典型用法代码示例。如果您正苦于以下问题:C++ Graphic::drawRectBorder方法的具体用法?C++ Graphic::drawRectBorder怎么用?C++ Graphic::drawRectBorder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Graphic
的用法示例。
在下文中一共展示了Graphic::drawRectBorder方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: render
void IndexedPickerScene::render(Graphic& dst,
Box srcbox,
double scale) {
if ((nativeBuffer_.w() != srcbox.w())
|| (nativeBuffer_.h() != srcbox.h())) {
nativeBuffer_ = Graphic(srcbox.w(), srcbox.h());
}
renderNative(nativeBuffer_,
srcbox);
int scaledW = srcbox.w() * sceneScale_;
int scaledH = srcbox.h() * sceneScale_;
nativeBuffer_.scale(dst,
Box(0, 0,
scaledW,
scaledH));
if (gridLayerEnabled_) {
gridLayer_.render(dst,
Box(srcbox.x(),
srcbox.y(),
scaledW,
scaledH),
sceneScale_);
}
if ((highlightedSelectableBoxEnabled_)) {
dst.drawRectBorder(selectableIndexToDrawX(highlightedSelectableIndex_),
selectableIndexToDrawY(highlightedSelectableIndex_),
selectableWidth_ * sceneScale_,
selectableHeight_ * sceneScale_,
Color(0xFF, 0x00, 0x00, Color::fullAlphaOpacity),
2);
}
if ((pickedSelectableBoxEnabled_)) {
dst.drawRectBorder(selectableIndexToDrawX(pickedSelectableIndex_),
selectableIndexToDrawY(pickedSelectableIndex_),
selectableWidth_ * sceneScale_,
selectableHeight_ * sceneScale_,
Color(0xFF, 0xFF, 0x00, Color::fullAlphaOpacity),
2);
}
}
示例2: drawMetatileEffect
//.........这里部分代码省略.........
metatileGraphic.setPixel(j, k + 1, Color(0xFF, 0xFF, 0xFF,
Color::fullAlphaOpacity));
metatileGraphic.setPixel(j + 1, k + 1, Color(0xFF, 0xFF, 0xFF,
Color::fullAlphaOpacity));
}
}
break;
case MetatileTypes::bombable:
metatileGraphic.clear(
Color(0xFF, 0x80, 0x00, Color::fullAlphaOpacity));
// large bomb
if ((indexNum == 0x63) || (indexNum == 0x64) || (indexNum == 0x65)) {
metatileGraphic.fillRect(3, 5, 11, 10,
Color(0, 0, 0, Color::fullAlphaOpacity),
Graphic::noTransUpdate);
metatileGraphic.drawLine(8, 5,
8, 2,
Color(0, 0, 0, Color::fullAlphaOpacity),
1);
}
// regular bomb
else {
metatileGraphic.fillRect(5, 5, 7, 7,
Color(0, 0, 0, Color::fullAlphaOpacity),
Graphic::noTransUpdate);
metatileGraphic.drawLine(8, 5,
8, 2,
Color(0, 0, 0, Color::fullAlphaOpacity),
1);
}
// ring
if (indexNum == 0x9E) {
metatileGraphic.drawRectBorder(7, 7, 3, 3,
Color(0xFF, 0xFF, 0, Color::fullAlphaOpacity),
1,
Graphic::noTransUpdate);
}
break;
case MetatileTypes::conveyorRight:
metatileGraphic.clear(
Color(0x80, 0x00, 0x80, Color::fullAlphaOpacity));
switch (indexNum) {
case 0x74:
metatileGraphic.drawLine(0, 8,
15, 8,
Color(0xFF, 0x80, 0x80,
Color::fullAlphaOpacity),
1);
metatileGraphic.drawLine(0, 8,
8, 0,
Color(0xFF, 0x80, 0x80,
Color::fullAlphaOpacity),
1);
metatileGraphic.drawLine(0, 8,
8, 15,
Color(0xFF, 0x80, 0x80,
Color::fullAlphaOpacity),
1);
break;
case 0x75:
metatileGraphic.drawLine(0, 8,
15, 8,
Color(0xFF, 0x80, 0x80,
Color::fullAlphaOpacity),
1);
示例3: render
void MetatilePickerLayeredGraphicScene::render(Graphic& dst,
Box srcbox,
double scale) {
dst.clear();
int metatileNum = 0;
for (int j = 0; j < metatilesPerColumn_; j++) {
for (int i = 0; i < metatilesPerRow_; i++) {
if (bgLayerEnabled_) {
dst.blit(metatilesVisualBG_[metatileNum],
Box(i * MetatileStructure::metatileWidth,
j * MetatileStructure::metatileHeight,
MetatileStructure::metatileWidth,
MetatileStructure::metatileHeight),
Graphic::transUpdate);
}
if (fgLayerEnabled_) {
dst.blit(metatilesVisualFG_[metatileNum],
Box(i * MetatileStructure::metatileWidth,
j * MetatileStructure::metatileHeight,
MetatileStructure::metatileWidth,
MetatileStructure::metatileHeight),
Graphic::transUpdate);
}
if (effectLayerEnabled_) {
dst.blit(metatilesEffect_[metatileNum],
Box(i * MetatileStructure::metatileWidth,
j * MetatileStructure::metatileHeight,
MetatileStructure::metatileWidth,
MetatileStructure::metatileHeight),
Graphic::noTransUpdate);
}
if (verticalSolidityLayerEnabled_) {
dst.blit(metatilesVerticalSolidity_[metatileNum],
Box(i * MetatileStructure::metatileWidth,
j * MetatileStructure::metatileHeight,
MetatileStructure::metatileWidth,
MetatileStructure::metatileHeight),
Graphic::noTransUpdate);
}
if (horizontalSolidityLayerEnabled_) {
dst.blit(metatilesHorizontalSolidity_[metatileNum],
Box(i * MetatileStructure::metatileWidth,
j * MetatileStructure::metatileHeight,
MetatileStructure::metatileWidth,
MetatileStructure::metatileHeight),
Graphic::noTransUpdate);
}
++metatileNum;
}
}
if (gridLayerEnabled_) {
gridLayer_.render(dst,
Box(srcbox.x(),
srcbox.y(),
dst.w(),
dst.h()),
1.00);
}
if ((highlightedMetatileBoxEnabled_)) {
dst.drawRectBorder(metatileIndexToX(highlightedMetatileIndex_),
metatileIndexToY(highlightedMetatileIndex_),
MetatileStructure::metatileWidth,
MetatileStructure::metatileHeight,
Color(0xFF, 0xFF, 0x00, Color::fullAlphaOpacity),
2);
}
if ((toolManager_->currentTool() == LevelEditorTools::metatilePaint)) {
dst.drawRectBorder(metatileIndexToX(toolManager_->pickedMetatileIndex()),
metatileIndexToY(toolManager_->pickedMetatileIndex()),
MetatileStructure::metatileWidth,
MetatileStructure::metatileHeight,
Color(0xFF, 0x00, 0x00, Color::fullAlphaOpacity),
2);
}
}