Class Panel
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
LayoutRootThe layout root to draw the panel on
background
SpriteThe sprite of the background
name
stringThe 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
MinHeight
The minimum height of the background
public float MinHeight { get; set; }
Property Value
MinWidth
The minimum width of the background
public float MinWidth { get; set; }
Property Value
Methods
ArrangeOverride(Vector2)
Internal implementation to position the object within the allocated space.
protected override void ArrangeOverride(Vector2 alignedTopLeftCorner)
Parameters
alignedTopLeftCorner
Vector2The 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()