Vertices Engine
v1.9.2.92
A Cross Platform game engine developed by Virtex Edge Design.
|
Layout class that supports title safe area. More...
Public Member Functions | |
vxLayout (Rectangle clientArea, Rectangle safeArea) | |
Construct layout object by specify both client area and safe area. | |
vxLayout (Rectangle clientArea) | |
Construct layout object by specify client area. Safe area becomes same size as client area. | |
vxLayout (Viewport viewport) | |
Construct layout object by specify viewport. Safe area becomes same as Viewpoert.TItleSafeArea. | |
Vector2 | Place (Vector2 size, float horizontalMargin, float verticalMargine, Alignment alignment) |
Layouting specified region. | |
Rectangle | Place (Rectangle region, float horizontalMargin, float verticalMargine, Alignment alignment) |
Layouting specified region. | |
Static Public Member Functions | |
static Vector2 | GetScaledSize (float x, float y) |
static Vector2 | GetScaledSize (Vector2 vector2) |
static int | GetScaledSize (float i) |
Returns an integer scaled value based off of the screen size. | |
static int | GetScaledWidth (float i) |
static int | GetScaledHeight (float i) |
static void | SetLayoutScale (Point screenSize, Point IdealScreenSize) |
static Vector2 | GetVector2 (Rectangle rectangle, float padding=0) |
static Vector2 | GetVector2 (Rectangle rectangle, float paddingX, float paddingY) |
static Vector2 | GetVector2 (Rectangle rectangle, Vector2 padding) |
static Vector2 | GetVector2 (Point point) |
static Vector2 | GetAnchor (vxLayoutJustification layoutJustification, Vector2 size) |
Returns the anchor offset for a given vxLayoutJustification and Vector2 size. | |
static Rectangle | GetRect (float x, float y, float w, float h) |
static Rectangle | GetRect (Point pos, float w, float h) |
static Rectangle | GetRect (Vector2 pos, float w, float h) |
static Rectangle | GetRect (Vector2 pos, Vector2 size) |
static Rectangle | GetRect (Vector2 pos, float sqSize) |
static Rectangle | GetRect (Point pos, float sqSize) |
Public Attributes | |
Rectangle | ClientArea |
Gets/Sets client area. | |
Rectangle | SafeArea |
Gets/Sets safe area. | |
Layout class that supports title safe area.
You have to support various resolutions when you develop multi-platform games. Also, you have to support title safe area for Xbox 360 games.
This structure places given rectangle with specified alignment and margin based on layout area (client area) with safe area.
Margin is percentage of client area size.
Example:
Place( region, 0.1f, 0.2f, Aligment.TopLeft );
Place region at 10% from left side of the client area, 20% from top of the client area.
Place( region, 0.3f, 0.4f, Aligment.BottomRight );
Place region at 30% from right side of client, 40% from the bottom of the client area.
You can individually specify client area and safe area. So, it is useful when you have split screen game which layout happens based on client and it takes care of the safe at same time.
VerticesEngine.UI.vxLayout.vxLayout | ( | Rectangle | clientArea, |
Rectangle | safeArea ) |
Construct layout object by specify both client area and safe area.
client | Client area |
safeArea | safe area |
VerticesEngine.UI.vxLayout.vxLayout | ( | Rectangle | clientArea | ) |
Construct layout object by specify client area. Safe area becomes same size as client area.
client | Client area |
|
static |
Returns the anchor offset for a given vxLayoutJustification and Vector2 size.
layoutJustification | |
size |
|
static |
Returns an integer scaled value based off of the screen size.
i |
Rectangle VerticesEngine.UI.vxLayout.Place | ( | Rectangle | region, |
float | horizontalMargin, | ||
float | verticalMargine, | ||
Alignment | alignment ) |
Layouting specified region.
region | placing rectangle |
Vector2 VerticesEngine.UI.vxLayout.Place | ( | Vector2 | size, |
float | horizontalMargin, | ||
float | verticalMargine, | ||
Alignment | alignment ) |
Layouting specified region.
region | placing region |