Skip to content

UIPanel Class

Definition

Namespace: Brine2D.UI

Panel/container UI component with background.

C#
public class UIPanel : Brine2D.UI.IUIComponent, Brine2D.UI.IAnchoredUIComponent

Inheritance System.Object → UIPanel

Implements IUIComponent, IAnchoredUIComponent

Properties
Anchor The screen anchor point this component is positioned relative to.
AnchorOffset Pixel offset from the resolved anchor point.
BackgroundColor Background color.
BackgroundTexture Optional nine-slice background texture. When set, replaces the solid BackgroundColor fill. The solid color border \(if any\) is still drawn on top.
BackgroundTextureBorder Nine-slice border insets \(texels\) for BackgroundTexture.
BackgroundTextureTint Tint color applied to BackgroundTexture. Defaults to white \(no tint\).
BlocksInput When true, mouse events over this panel are consumed. Defaults to false.
BorderColor Border color \(optional\).
BorderThickness Border thickness in pixels.
ClipChildren When true, child components are clipped to the panel's bounds during rendering. Defaults to false.
LastKnownScreenSize Last screen size pushed by UICanvas. Used when propagating to children added after this panel is already on a canvas.
Methods
AddChild\(IUIComponent\) Adds a child component. Child positions are parent-relative: \(0, 0\) places the child at the top-left corner of this panel.
ClearChildren() Removes all child components.
GetChildren() Gets all child components.
RemoveChild\(IUIComponent\) Removes a child component.