CUIAnchor is just a Vector2
This is a static class containing some helper methods.
More...
|
static Vector2 | TopLeft = new Vector2(0.0f, 0.0f) |
|
static Vector2 | TopCenter = new Vector2(0.5f, 0.0f) |
|
static Vector2 | TopRight = new Vector2(1.0f, 0.0f) |
|
static Vector2 | CenterLeft = new Vector2(0.0f, 0.5f) |
|
static Vector2 | Center = new Vector2(0.5f, 0.5f) |
|
static Vector2 | CenterRight = new Vector2(1.0f, 0.5f) |
|
static Vector2 | BottomLeft = new Vector2(0.0f, 1.0f) |
|
static Vector2 | BottomCenter = new Vector2(0.5f, 1.0f) |
|
static Vector2 | BottomRight = new Vector2(1.0f, 1.0f) |
|
CUIAnchor is just a Vector2
This is a static class containing some helper methods.
Definition at line 17 of file CUIAnchor.cs.
◆ AnchorFromPos()
static Vector2 CrabUI.CUIAnchor.AnchorFromPos |
( |
CUIRect | rect, |
|
|
Vector2 | pos ) |
|
static |
Definition at line 43 of file CUIAnchor.cs.
44 {
45 return (pos - rect.Position) / rect.Size;
46 }
◆ Direction()
static Vector2 CrabUI.CUIAnchor.Direction |
( |
Vector2 | anchor | ) |
|
|
static |
Definition at line 29 of file CUIAnchor.cs.
30 {
31 return (Center - anchor) * 2;
32 }
◆ GetChildPos() [1/2]
static Vector2 CrabUI.CUIAnchor.GetChildPos |
( |
CUIRect | parent, |
|
|
Vector2 | anchor, |
|
|
Vector2 | offset, |
|
|
Vector2 | childSize ) |
|
static |
Definition at line 48 of file CUIAnchor.cs.
49 {
50 return PosIn(parent, anchor) + offset - PosIn(new CUIRect(childSize), anchor);
51 }
◆ GetChildPos() [2/2]
static Vector2 CrabUI.CUIAnchor.GetChildPos |
( |
CUIRect | parent, |
|
|
Vector2 | parentAnchor, |
|
|
Vector2 | offset, |
|
|
Vector2 | childSize, |
|
|
Vector2 | anchor ) |
|
static |
Definition at line 53 of file CUIAnchor.cs.
54 {
55 return PosIn(parent, parentAnchor) + offset - PosIn(new CUIRect(childSize), anchor);
56 }
◆ PosIn()
static Vector2 CrabUI.CUIAnchor.PosIn |
( |
CUIRect | rect, |
|
|
Vector2 | anchor ) |
|
static |
Definition at line 35 of file CUIAnchor.cs.
36 {
37 return new Vector2(
38 rect.Left + rect.Width * anchor.X,
39 rect.Top + rect.Height * anchor.Y
40 );
41 }
◆ BottomCenter
Vector2 CrabUI.CUIAnchor.BottomCenter = new Vector2(0.5f, 1.0f) |
|
static |
◆ BottomLeft
Vector2 CrabUI.CUIAnchor.BottomLeft = new Vector2(0.0f, 1.0f) |
|
static |
◆ BottomRight
Vector2 CrabUI.CUIAnchor.BottomRight = new Vector2(1.0f, 1.0f) |
|
static |
◆ Center
Vector2 CrabUI.CUIAnchor.Center = new Vector2(0.5f, 0.5f) |
|
static |
◆ CenterLeft
Vector2 CrabUI.CUIAnchor.CenterLeft = new Vector2(0.0f, 0.5f) |
|
static |
◆ CenterRight
Vector2 CrabUI.CUIAnchor.CenterRight = new Vector2(1.0f, 0.5f) |
|
static |
◆ TopCenter
Vector2 CrabUI.CUIAnchor.TopCenter = new Vector2(0.5f, 0.0f) |
|
static |
◆ TopLeft
Vector2 CrabUI.CUIAnchor.TopLeft = new Vector2(0.0f, 0.0f) |
|
static |
◆ TopRight
Vector2 CrabUI.CUIAnchor.TopRight = new Vector2(1.0f, 0.0f) |
|
static |
The documentation for this class was generated from the following file: