+ break;
+
+ case TOP_ALIGNMENT:
+ for(int x = start_x; x < end_x; ++x)
+ {
+ Vector p(pos_.x + x * image->get_width() - image->get_width() / 2.0f,
+ pos_.y - parallax_image_size.height / 2.0f);
+ context.draw_surface(image, p, layer);
+ }
+ break;
+
+ case BOTTOM_ALIGNMENT:
+ for(int x = start_x; x < end_x; ++x)
+ {
+ Vector p(pos_.x + x * image->get_width() - image->get_width() / 2.0f,
+ pos_.y - image->get_height() + parallax_image_size.height / 2.0f);
+ context.draw_surface(image, p, layer);
+ }
+ break;
+
+ case NO_ALIGNMENT:
+ for(int y = start_y; y < end_y; ++y)
+ for(int x = start_x; x < end_x; ++x)
+ {
+ Vector p(pos_.x + x * image->get_width() - image->get_width()/2,
+ pos_.y + y * image->get_height() - image->get_height()/2);
+
+ if (image_top.get() != NULL && (y < 0))
+ {
+ context.draw_surface(image_top, p, layer);
+ }
+ else if (image_bottom.get() != NULL && (y > 0))
+ {
+ context.draw_surface(image_bottom, p, layer);
+ }
+ else
+ {
+ context.draw_surface(image, p, layer);
+ }
+ }
+ break;