当前位置: 首页>>代码示例>>C++>>正文


C++ Graphic::drawRectBorder方法代码示例

本文整理汇总了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);
  }
}
开发者ID:GerbilSoft,项目名称:tales,代码行数:46,代码来源:IndexedPickerScene.cpp

示例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);
开发者ID:suppertails66,项目名称:tales,代码行数:67,代码来源:LevelEffectGraphicSceneLayer.cpp

示例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);
  }
}
开发者ID:suppertails66,项目名称:tales,代码行数:84,代码来源:MetatilePickerLayeredGraphicScene.cpp


注:本文中的Graphic::drawRectBorder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。