C# Class TimeRulerLibrary.Layout

Layout class that supports title safe area.
You have to support various resolution 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 parcentage of client area size. Exmpale: 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 happends based on client and it takes carea of the safe at same time.
Mostrar archivo Open project: jaquadro/MonoGdx Class Usage Examples

Public Properties

Property Type Description
ClientArea Microsoft.Xna.Framework.Rectangle
SafeArea Microsoft.Xna.Framework.Rectangle

Public Methods

Method Description
Layout ( Rectangle clientArea ) : System

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

Layout ( Rectangle clientArea, Rectangle safeArea ) : System

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

Layout ( Viewport viewport ) : System

Construct layout object by specify viewport. Safe area becomes same as Viewpoert.TItleSafeArea.

Place ( Rectangle region, float horizontalMargin, float verticalMargine, Alignment alignment ) : Rectangle

Layouting specified region

Place ( Vector2 size, float horizontalMargin, float verticalMargine, Alignment alignment ) : Vector2

Layouting specified region

Method Details

Layout() public method

Construct layout object by specify client area. Safe area becomes same size as client area.
public Layout ( Rectangle clientArea ) : System
clientArea Microsoft.Xna.Framework.Rectangle
return System

Layout() public method

Construct layout object by specify both client area and safe area.
public Layout ( Rectangle clientArea, Rectangle safeArea ) : System
clientArea Microsoft.Xna.Framework.Rectangle
safeArea Microsoft.Xna.Framework.Rectangle safe area
return System

Layout() public method

Construct layout object by specify viewport. Safe area becomes same as Viewpoert.TItleSafeArea.
public Layout ( Viewport viewport ) : System
viewport Microsoft.Xna.Framework.Graphics.Viewport
return System

Place() public method

Layouting specified region
public Place ( Rectangle region, float horizontalMargin, float verticalMargine, Alignment alignment ) : Rectangle
region Microsoft.Xna.Framework.Rectangle placing rectangle
horizontalMargin float
verticalMargine float
alignment Alignment
return Microsoft.Xna.Framework.Rectangle

Place() public method

Layouting specified region
public Place ( Vector2 size, float horizontalMargin, float verticalMargine, Alignment alignment ) : Vector2
size Vector2
horizontalMargin float
verticalMargine float
alignment Alignment
return Vector2

Property Details

ClientArea public_oe property

Gets/Sets client area.
public Rectangle,Microsoft.Xna.Framework ClientArea
return Microsoft.Xna.Framework.Rectangle

SafeArea public_oe property

Gets/Sets safearea.
public Rectangle,Microsoft.Xna.Framework SafeArea
return Microsoft.Xna.Framework.Rectangle