Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/src/ceguilua/ceguilua-0.5.0/package/UnifiedCoordSystem.pkg @ 3607

Last change on this file since 3607 was 2710, checked in by rgrieder, 16 years ago

Merged buildsystem3 containing buildsystem2 containing Adi's buildsystem branch back to the trunk.
Please update the media directory if you were not using buildsystem3 before.

  • Property svn:eol-style set to native
File size: 1.9 KB
RevLine 
[2608]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.