本文整理汇总了C++中Image::DrawRound方法的典型用法代码示例。如果您正苦于以下问题:C++ Image::DrawRound方法的具体用法?C++ Image::DrawRound怎么用?C++ Image::DrawRound使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Image
的用法示例。
在下文中一共展示了Image::DrawRound方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Render
void Widget::Render()
{
Image* scr = Screen::Instance();
if (mBorderColor.a != 0) //default will have a zero alpha
scr->DrawRound(GetScreenPosition(), 0, mBorderColor);
for (int i = 0; i < mChildren.size(); i++)
{
if (mChildren.at(i)->mVisible)
mChildren.at(i)->Render();
}
}
示例2: Render
void TerrainTest::Render()
{
Image* scr = Screen::Instance();
if (!grid)
return;
color c;
tile* t;
tile* tt;
for (int y = 0; y < height; y++)
{
for (int x = 0; x < width; x++)
{
t = GetTile(x, y);
c.r = c.g = c.b = t->height * 25;
scr->DrawRect( rect(x*TILE_SIZE, y*TILE_SIZE, TILE_SIZE, TILE_SIZE), c, true);
if (m_bDisplayTypeMap)
{
//Mark tile types
c = color();
switch (GetTileType(x, y))
{
case TILE_SOUTHEDGE:
c.r = 255;
break;
case TILE_WESTEDGE:
c.g = 255;
break;
case TILE_EASTEDGE:
c.b = 255;
break;
case TILE_NORTHEDGE:
c.r = c.g = 255;
break;
case TILE_SWEDGE:
c.r = 128;
break;
case TILE_SEEDGE:
c.g = 128;
break;
case TILE_NWEDGE:
c.b = 128;
break;
case TILE_NEEDGE:
c.r = c.g = 128;
break;
case TILE_SWBEND:
c.g = c.b = 255;
break;
case TILE_SEBEND:
c.g = c.b = 128;
break;
case TILE_NEBEND:
c.r = c.b = 255;
break;
case TILE_NWBEND:
c.r = c.b = 128;
break;
default: break;
}
if (!isDefaultColor(c))
scr->DrawRound( x*TILE_SIZE, y*TILE_SIZE, TILE_SIZE, TILE_SIZE, TILE_SIZE/2, c);
}
//Render edge lines for all tiles that have too drastic a height difference between them
tt = GetTile(x, y-1);
if (tt)
{
if (tt->height > t->height+1)
scr->DrawLine(x*TILE_SIZE, y*TILE_SIZE, x*TILE_SIZE+16, y*TILE_SIZE, color(255), 2);
else if (tt->height+1 < t->height)
scr->DrawLine(x*TILE_SIZE, y*TILE_SIZE, x*TILE_SIZE+16, y*TILE_SIZE, color(0,255), 2);
}
tt = GetTile(x, y+1);
if (tt)
{
if (tt->height > t->height+1)
scr->DrawLine(x*TILE_SIZE, y*TILE_SIZE+14, x*TILE_SIZE+16, y*TILE_SIZE+14, color(255), 2);
else if (tt->height+1 < t->height)
scr->DrawLine(x*TILE_SIZE, y*TILE_SIZE+14, x*TILE_SIZE+16, y*TILE_SIZE+14, color(0,255), 2);
}
tt = GetTile(x+1, y);
if (tt)
{
if (tt->height > t->height+1)
scr->DrawLine(x*TILE_SIZE+14, y*TILE_SIZE, x*TILE_SIZE+14, y*TILE_SIZE+14, color(255), 2);
else if (tt->height+1 < t->height)
scr->DrawLine(x*TILE_SIZE+14, y*TILE_SIZE, x*TILE_SIZE+14, y*TILE_SIZE+14, color(0,255), 2);
}
tt = GetTile(x-1, y);
if (tt)
{
if (tt->height > t->height+1)
scr->DrawLine(x*TILE_SIZE, y*TILE_SIZE, x*TILE_SIZE, y*TILE_SIZE+14, color(255), 2);
//.........这里部分代码省略.........