本文整理汇总了C++中DrawingContext::draw_surface_part方法的典型用法代码示例。如果您正苦于以下问题:C++ DrawingContext::draw_surface_part方法的具体用法?C++ DrawingContext::draw_surface_part怎么用?C++ DrawingContext::draw_surface_part使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DrawingContext
的用法示例。
在下文中一共展示了DrawingContext::draw_surface_part方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: draw
void Editor::draw(DrawingContext& context)
{
if (levelloaded) {
currentsector->draw(context);
context.draw_filled_rect(Rectf(Vector(0, 0), Vector(SCREEN_WIDTH, SCREEN_HEIGHT)), Color(0.0f, 0.0f, 0.0f),
0.0f, std::numeric_limits<int>::min());
} else {
context.draw_surface_part(bgr_surface, Rectf(Vector(0, 0), bgr_surface->get_size()),
Rectf(Vector(0, 0), Vector(SCREEN_WIDTH, SCREEN_HEIGHT)), -100);
}
inputcenter.draw(context);
tileselect.draw(context);
layerselect.draw(context);
scroller.draw(context);
MouseCursor::current()->draw(context);
}
示例2: Vector
void
TextScroller::draw(DrawingContext& context)
{
context.draw_filled_rect(Vector(0, 0), Vector(SCREEN_WIDTH, SCREEN_HEIGHT),
Color(0.6f, 0.7f, 0.8f, 0.5f), 0);
context.draw_surface_part(background, Rectf(0, 0, background->get_width(), background->get_height()),
Rectf(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT), 0);
float y = SCREEN_HEIGHT - scroll;
for (auto& line : lines) {
if (y + line->get_height() >= 0 && SCREEN_HEIGHT - y >= 0) {
line->draw(context, Rectf(LEFT_BORDER, y, SCREEN_WIDTH - 2*LEFT_BORDER, y), LAYER_GUI);
}
y += line->get_height();
}
if(y < 0 && !fading ) {
fading = true;
ScreenManager::current()->pop_screen(std::unique_ptr<ScreenFade>(new FadeOut(0.5)));
}
}
示例3: Rectf
void
ObjectIcon::draw(DrawingContext& context, Vector pos) {
context.draw_surface_part(surface, Rectf(Vector(0,0), surface->get_size()),
Rectf(pos + offset, pos + Vector(32,32) - offset), LAYER_GUI - 9);
}