Rectangle with float.
More...
|
| static Rectangle | CreateRect (float x, float y, float w, float h) |
| | IDK where to put it.
|
| |
Rectangle with float.
Definition at line 16 of file CUIRect.cs.
◆ CUIRect() [1/3]
| CrabUI.CUIRect.CUIRect |
( |
Vector2 | size | ) |
|
Definition at line 85 of file CUIRect.cs.
85: this(0, 0, size.X, size.Y) { }
◆ CUIRect() [2/3]
| CrabUI.CUIRect.CUIRect |
( |
Vector2 | position, |
|
|
Vector2 | size ) |
Definition at line 86 of file CUIRect.cs.
86: this(position.X, position.Y, size.X, size.Y) { }
◆ CUIRect() [3/3]
| CrabUI.CUIRect.CUIRect |
( |
float | x, |
|
|
float | y, |
|
|
float | w, |
|
|
float | h ) |
Definition at line 87 of file CUIRect.cs.
88 {
89 Left = x;
90 Top = y;
91 Width = Math.Max(0f, w);
92 Height = Math.Max(0f, h);
93 }
◆ Contains() [1/2]
| bool CrabUI.CUIRect.Contains |
( |
float | x, |
|
|
float | y ) |
Definition at line 57 of file CUIRect.cs.
58 {
59 return Left < x && x < Right && Top < y && y < Bottom;
60 }
◆ Contains() [2/2]
| bool CrabUI.CUIRect.Contains |
( |
Vector2 | pos | ) |
|
Definition at line 61 of file CUIRect.cs.
62 {
63 return Left < pos.X && pos.X < Right && Top < pos.Y && pos.Y < Bottom;
64 }
◆ CreateRect()
| static Rectangle CrabUI.CUIRect.CreateRect |
( |
float | x, |
|
|
float | y, |
|
|
float | w, |
|
|
float | h ) |
|
static |
IDK where to put it.
Definition at line 21 of file CUIRect.cs.
22 {
23 return new Rectangle((int)Math.Round(x), (int)Math.Round(y), (int)Math.Round(w), (int)Math.Round(h));
24 }
◆ Intersect()
| bool CrabUI.CUIRect.Intersect |
( |
CUIRect | r | ) |
|
Definition at line 65 of file CUIRect.cs.
66 {
67 return r.Right >= Left && r.Left <= Right && r.Bottom >= Top && r.Top <= Bottom;
68 }
◆ Shift()
| CUIRect CrabUI.CUIRect.Shift |
( |
Vector2 | shift | ) |
|
Definition at line 52 of file CUIRect.cs.
53 {
54 return new CUIRect(Left + shift.X, Top + shift.Y, Width, Height);
55 }
◆ Zoom()
| Rectangle CrabUI.CUIRect.Zoom |
( |
float | Z | ) |
|
Definition at line 70 of file CUIRect.cs.
71 {
72 Vector2 ScreenCenter = CUI.GameScreenSize / 2.0f;
73 Vector2 PosDif = Position - ScreenCenter;
74 Vector2 newPos = PosDif * Z + ScreenCenter;
75
76 return new Rectangle(
77 (int)newPos.X, (int)newPos.Y,
78 (int)(Width / Z), (int)(Height / Z)
79 );
80 }
◆ Height
| float CrabUI.CUIRect.Height |
◆ Left
| float CrabUI.CUIRect.Left |
◆ Top
◆ Width
| float CrabUI.CUIRect.Width |
◆ Bottom
| float CrabUI.CUIRect.Bottom |
|
get |
◆ Box
| Rectangle CrabUI.CUIRect.Box |
|
get |
◆ Center
| Vector2 CrabUI.CUIRect.Center |
|
get |
◆ CenterBottom
| Vector2 CrabUI.CUIRect.CenterBottom |
|
get |
◆ CenterCenter
| Vector2 CrabUI.CUIRect.CenterCenter |
|
get |
◆ CenterTop
| Vector2 CrabUI.CUIRect.CenterTop |
|
get |
◆ LeftBottom
| Vector2 CrabUI.CUIRect.LeftBottom |
|
get |
◆ LeftCenter
| Vector2 CrabUI.CUIRect.LeftCenter |
|
get |
◆ LeftTop
| Vector2 CrabUI.CUIRect.LeftTop |
|
get |
◆ Position
| Vector2 CrabUI.CUIRect.Position |
|
get |
◆ Right
| float CrabUI.CUIRect.Right |
|
get |
◆ RightBottom
| Vector2 CrabUI.CUIRect.RightBottom |
|
get |
◆ RightCenter
| Vector2 CrabUI.CUIRect.RightCenter |
|
get |
◆ RightTop
| Vector2 CrabUI.CUIRect.RightTop |
|
get |
◆ Size
| Vector2 CrabUI.CUIRect.Size |
|
get |
The documentation for this struct was generated from the following file: