Defining Boundaries, not the same as rect
containing min/max x, y, z.
More...
|
CUIRect | Check (float x, float y, float w, float h) |
|
CUI3DOffset | Check (CUI3DOffset offset) |
|
CUI3DOffset | Check (float x, float y, float z) |
|
| CUIBoundaries (float? minX=null, float? maxX=null, float? minY=null, float? maxY=null, float? minZ=null, float? maxZ=null) |
|
override string | ToString () |
|
|
static Func< CUIRect, CUIBoundaries > | Free = (Rect) => new CUIBoundaries(null, null, null, null) |
|
static Func< CUIRect, CUIBoundaries > | Box = (Rect) => new CUIBoundaries(0, Rect.Width, 0, Rect.Height) |
|
static Func< CUIRect, CUIBoundaries > | HorizontalTube = (Rect) => new CUIBoundaries(null, null, 0, Rect.Height) |
|
static Func< CUIRect, CUIBoundaries > | VerticalTube = (Rect) => new CUIBoundaries(0, Rect.Width, null, null) |
|
Defining Boundaries, not the same as rect
containing min/max x, y, z.
Definition at line 18 of file CUIBoundaries.cs.
◆ CUIBoundaries()
CrabUI.CUIBoundaries.CUIBoundaries |
( |
float? | minX = null, |
|
|
float? | maxX = null, |
|
|
float? | minY = null, |
|
|
float? | maxY = null, |
|
|
float? | minZ = null, |
|
|
float? | maxZ = null ) |
Definition at line 63 of file CUIBoundaries.cs.
68 {
69 MinX = minX;
70 MaxX = maxX;
71 MinY = minY;
72 MaxY = maxY;
73 MinZ = minZ;
74 MaxZ = maxZ;
75 }
◆ Check() [1/2]
CUIRect CrabUI.CUIBoundaries.Check |
( |
float | x, |
|
|
float | y, |
|
|
float | w, |
|
|
float | h ) |
Definition at line 36 of file CUIBoundaries.cs.
37 {
38 if (MaxX.HasValue && x + w > MaxX.Value) x = MaxX.Value - w;
39 if (MaxY.HasValue && y + h > MaxY.Value) y = MaxY.Value - h;
40 if (MinX.HasValue && x < MinX.Value) x = MinX.Value;
41 if (MinY.HasValue && y < MinY.Value) y = MinY.Value;
42
43 return new CUIRect(x, y, w, h);
44 }
◆ Check() [2/2]
CUI3DOffset CrabUI.CUIBoundaries.Check |
( |
float | x, |
|
|
float | y, |
|
|
float | z ) |
Definition at line 48 of file CUIBoundaries.cs.
49 {
50 if (MaxX.HasValue && x > MaxX.Value) x = MaxX.Value;
51 if (MaxY.HasValue && y > MaxY.Value) y = MaxY.Value;
52 if (MaxZ.HasValue && z > MaxZ.Value) z = MaxZ.Value;
53
54 if (MinX.HasValue && x < MinX.Value) x = MinX.Value;
55 if (MinY.HasValue && y < MinY.Value) y = MinY.Value;
56 if (MinZ.HasValue && z < MinZ.Value) z = MinZ.Value;
57
58 return new CUI3DOffset(x, y, z);
59 }
◆ Box
◆ Free
◆ HorizontalTube
◆ MaxX
float? CrabUI.CUIBoundaries.MaxX |
◆ MaxY
float? CrabUI.CUIBoundaries.MaxY |
◆ MaxZ
float? CrabUI.CUIBoundaries.MaxZ |
◆ MinX
float? CrabUI.CUIBoundaries.MinX |
◆ MinY
float? CrabUI.CUIBoundaries.MinY |
◆ MinZ
float? CrabUI.CUIBoundaries.MinZ |
◆ VerticalTube
The documentation for this struct was generated from the following file: