C# Класс PerformanceMeasuring.GameDebugTools.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.
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
ClientArea Microsoft.Xna.Framework.Rectangle
SafeArea Microsoft.Xna.Framework.Rectangle

Открытые методы

Метод Описание
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

Описание методов

Layout() публичный Метод

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
Результат System

Layout() публичный Метод

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
Результат System

Layout() публичный Метод

Construct layout object by specify viewport. Safe area becomes same as Viewpoert.TItleSafeArea.
public Layout ( Viewport viewport ) : System
viewport Microsoft.Xna.Framework.Graphics.Viewport
Результат System

Place() публичный Метод

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
Результат Microsoft.Xna.Framework.Rectangle

Place() публичный Метод

Layouting specified region
public Place ( Vector2 size, float horizontalMargin, float verticalMargine, Alignment alignment ) : Vector2
size Vector2
horizontalMargin float
verticalMargine float
alignment Alignment
Результат Vector2

Описание свойств

ClientArea публичное свойство

Gets/Sets client area.
public Rectangle,Microsoft.Xna.Framework ClientArea
Результат Microsoft.Xna.Framework.Rectangle

SafeArea публичное свойство

Gets/Sets safearea.
public Rectangle,Microsoft.Xna.Framework SafeArea
Результат Microsoft.Xna.Framework.Rectangle