X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Ftextscroller.cpp;h=759a9c704b4a346534e222907b095393aa15ad6d;hb=d4b281559d45406a5d07cf04d89142cdeb90b114;hp=972a29d5e10890653ce54c7b8522e133bf8b4923;hpb=a113d3bd1feddd510e3b2852b0d42522735eee40;p=supertux.git diff --git a/src/textscroller.cpp b/src/textscroller.cpp index 972a29d5e..759a9c704 100644 --- a/src/textscroller.cpp +++ b/src/textscroller.cpp @@ -51,7 +51,7 @@ TextScroller::TextScroller(const std::string& filename) lisp::Parser parser; try { - std::auto_ptr root (parser.parse(filename)); + const lisp::Lisp* root = parser.parse(filename); const lisp::Lisp* text_lisp = root->get_lisp("supertux-text"); if(!text_lisp) @@ -118,7 +118,9 @@ TextScroller::update(float elapsed_time) void TextScroller::draw(DrawingContext& context) { - context.draw_surface(background.get(), Vector(0,0), 0); + 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(background.get(), Vector(SCREEN_WIDTH/2 - background->get_width()/2 , SCREEN_HEIGHT/2 - background->get_height()/2), 0); float y = SCREEN_HEIGHT - scroll; for(size_t i = 0; i < lines.size(); i++) { @@ -164,8 +166,8 @@ InfoBox::~InfoBox() void InfoBox::draw(DrawingContext& context) { - float x1 = 200; - float y1 = 100; + float x1 = SCREEN_WIDTH/2-200; + float y1 = SCREEN_HEIGHT/2-200; float width = 400; float height = 200; @@ -309,10 +311,10 @@ InfoBoxLine::draw(DrawingContext& context, const Vector& position, int layer) context.draw_surface(image, Vector( (SCREEN_WIDTH - image->get_width()) / 2, position.y), layer); break; case NORMAL_LEFT: - context.draw_text(font, text, Vector(position.x, position.y), LEFT_ALLIGN, layer); + context.draw_text(font, text, Vector(position.x, position.y), ALIGN_LEFT, layer); break; default: - context.draw_text(font, text, Vector(SCREEN_WIDTH/2, position.y), CENTER_ALLIGN, layer); + context.draw_text(font, text, Vector(SCREEN_WIDTH/2, position.y), ALIGN_CENTER, layer); break; } }