virtual void update(float elapsed_time);
virtual void draw(DrawingContext& context);
+ void draw_image(DrawingContext& context, const Vector& pos);
private:
+ enum Alignment {
+ NO_ALIGNMENT,
+ LEFT_ALIGNMENT,
+ RIGHT_ALIGNMENT,
+ TOP_ALIGNMENT,
+ BOTTOM_ALIGNMENT
+ };
+
+ /** Backgrounds with NO_ALIGNMENT are repeated over the whole
+ screen, backgrounds with left, right, top, bottom alignment are
+ only repeated in one direction and attached to the level edge */
+ Alignment alignment;
+
int layer;
std::string imagefile_top;
std::string imagefile;
float speed_y; /**< scroll-speed in vertical direction */
Vector scroll_speed;
Vector scroll_offset;
- std::auto_ptr<Surface> image_top; /**< image to draw above pos */
- std::auto_ptr<Surface> image; /**< image to draw, anchored at pos */
- std::auto_ptr<Surface> image_bottom; /**< image to draw below pos+screenheight */
+ SurfacePtr image_top; /**< image to draw above pos */
+ SurfacePtr image; /**< image to draw, anchored at pos */
+ SurfacePtr image_bottom; /**< image to draw below pos+screenheight */
};
#endif /*SUPERTUX_BACKGROUND_H*/