Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/tutorial/src/external/ceguilua/ceguilua-0.5.0/package/UnifiedCoordSystem.pkg @ 10117

Last change on this file since 10117 was 5781, checked in by rgrieder, 15 years ago

Reverted trunk again. We might want to find a way to delete these revisions again (x3n's changes are still available as diff in the commit mails).

  • Property svn:eol-style set to native
File size: 1.9 KB
Line 
1/***********************************************************************
2        UDim
3***********************************************************************/
4class UDim
5{
6        float d_scale @ scale;
7        float d_offset @ offset;
8
9        float asAbsolute(float base) const;
10        float asRelative(float base) const;
11
12        UDim operator+ (const UDim& other) const;
13        UDim operator- (const UDim& other) const;
14        UDim operator/ (const UDim& other) const;
15        UDim operator* (const UDim& other) const;
16
17        bool operator== (const UDim& other) const;
18
19        UDim();
20        UDim(float scale, float offset);
21};
22
23
24/***********************************************************************
25        UVector2
26***********************************************************************/
27class UVector2
28{
29        UDim d_x @ x;
30        UDim d_y @ y;
31
32        Vector2 asAbsolute(const Size& base) const;
33        Vector2 asRelative(const Size& base) const;
34
35        UVector2 operator+ (const UVector2& other) const;
36        UVector2 operator- (const UVector2& other) const;
37        UVector2 operator/ (const UVector2& other) const;
38        UVector2 operator* (const UVector2& other) const;
39
40        bool operator== (const UVector2& other) const;
41
42        UVector2();
43        UVector2(UDim& scale, UDim& offset);
44};
45
46
47/***********************************************************************
48        URect
49***********************************************************************/
50class URect
51{
52        UVector2 d_min @ min;
53        UVector2 d_max @ max;
54
55        Rect asAbsolute(const Size& base) const;
56        Rect asRelative(const Size& base) const;
57
58        const UVector2& getPosition() const;
59        UVector2 getSize() const;
60        UDim getWidth() const;
61        UDim getHeight() const;
62
63        void setPosition(const UVector2& pos);
64        void setSize(const UVector2& sz);
65        void setWidth(const UDim& w);
66        void setHeight(const UDim& h);
67
68        void offset(const UVector2& sz);
69
70        URect();
71        URect(const UVector2& min, const UVector2& max);
72        URect(const UDim& left, const UDim& top, const UDim& right, const UDim& bottom);
73};
Note: See TracBrowser for help on using the repository browser.