-Added new object system and converted some GameObjects to it.
[supertux.git] / src / viewport.h
1 #ifndef __VIEWPORT_H__
2 #define __VIEWPORT_H__
3
4 #include "vector.h"
5 #include "rectangle.h"
6
7 class ViewPort
8 {
9 public:
10   ViewPort();
11   ~ViewPort();
12
13   Vector world2screen(const Vector& worldpos) const
14   {
15     return worldpos - translation;
16   }
17     
18   /** returns the current translation (=scroll) vector of the viewport */
19   const Vector& get_translation() const
20   { return translation; }
21
22   void set_translation(const Vector& translation);
23
24 private:
25   Vector translation;
26 };
27
28 #endif
29