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); }
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))); } }
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); }