Table of Contents

Class Panel

Namespace
MagicUI.Elements
Assembly
MagicUI.dll

A container that overlays a single element on top of a background image. The background will always be scaled to surround the element. To have a Sprite scale without stretching its borders, use ToSlicedSprite(Texture2D, float, float, float, float) to create the sprite.

public sealed class Panel : Container, ILayoutParent
Inheritance
Panel
Implements
Inherited Members
Extension Methods

Constructors

Panel(LayoutRoot, Sprite, string)

Creates a panel

public Panel(LayoutRoot onLayout, Sprite background, string name = "New Panel")

Parameters

onLayout LayoutRoot

The layout root to draw the panel on

background Sprite

The sprite of the background

name string

The name of the panel

Properties

Borders

How far around the enclosed element the background will stretch to (left, top, right, bottom)

public Padding Borders { get; set; }

Property Value

Padding

MinHeight

The minimum height of the background

public float MinHeight { get; set; }

Property Value

float

MinWidth

The minimum width of the background

public float MinWidth { get; set; }

Property Value

float

Methods

ArrangeOverride(Vector2)

Internal implementation to position the object within the allocated space.

protected override void ArrangeOverride(Vector2 alignedTopLeftCorner)

Parameters

alignedTopLeftCorner Vector2

The space available for the element.

DestroyOverride()

Internal implementation to perform any additional cleanup when the element is destroyed

protected override void DestroyOverride()

MeasureOverride()

Internal implementation to calculate desired size.

protected override Vector2 MeasureOverride()

Returns

Vector2