lisp::Parser parser;
try {
- std::auto_ptr<lisp::Lisp> root (parser.parse(filename));
+ const lisp::Lisp* root = parser.parse(filename);
const lisp::Lisp* text_lisp = root->get_lisp("supertux-text");
if(!text_lisp)
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++) {
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;
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;
}
}