Vertices Engine  v1.9.2.92
A Cross Platform game engine developed by Virtex Edge Design.
Loading...
Searching...
No Matches
VerticesEngine.UI.vxLayout Class Reference

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.
 

Properties

static Point IdealScreenSize [get, set]
 The ideal screen size used for UI Scaling.
 
static float ScaleAvg [get]
 The screen size scaler that is the average of the x and y components.
 
static Vector2 Scale [get]
 The screen size scaler for handling different Screen Sizes.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ vxLayout() [1/2]

VerticesEngine.UI.vxLayout.vxLayout ( Rectangle clientArea,
Rectangle safeArea )

Construct layout object by specify both client area and safe area.

Parameters
clientClient area
safeAreasafe area

◆ vxLayout() [2/2]

VerticesEngine.UI.vxLayout.vxLayout ( Rectangle clientArea)

Construct layout object by specify client area. Safe area becomes same size as client area.

Parameters
clientClient area

Member Function Documentation

◆ GetAnchor()

static Vector2 VerticesEngine.UI.vxLayout.GetAnchor ( vxLayoutJustification layoutJustification,
Vector2 size )
static

Returns the anchor offset for a given vxLayoutJustification and Vector2 size.

Parameters
layoutJustification
size
Returns

◆ GetScaledSize()

static int VerticesEngine.UI.vxLayout.GetScaledSize ( float i)
static

Returns an integer scaled value based off of the screen size.

Parameters
i
Returns

◆ Place() [1/2]

Rectangle VerticesEngine.UI.vxLayout.Place ( Rectangle region,
float horizontalMargin,
float verticalMargine,
Alignment alignment )

Layouting specified region.

Parameters
regionplacing rectangle
Returns
placed rectangle

◆ Place() [2/2]

Vector2 VerticesEngine.UI.vxLayout.Place ( Vector2 size,
float horizontalMargin,
float verticalMargine,
Alignment alignment )

Layouting specified region.

Parameters
regionplacing region
Returns
Placed position

The documentation for this class was generated from the following file: