FirstModulAR 0.1.0
Loading...
Searching...
No Matches
FMAR.UI.Widgets.WidgetContainer Class Reference

An object that can hold a widget. Allows the ability to move widgets around between various containers, and to lock the widget to prevent moving. More...

Inheritance diagram for FMAR.UI.Widgets.WidgetContainer:
FMAR.UI.Widgets.DockElement FMAR.UI.Widgets.FloatingDisplay FMAR.UI.Widgets.GridSlot FMAR.UI.Widgets.Tab FMAR.UI.Widgets.TabbedDisplaySlot

Public Member Functions

virtual WidgetContainer Init (Widget widget, Vector2 size, bool disableCollidersOverride=false, float scaleFactor=-1, bool disableInitEvent=false)
 Initializes the widget container.
 
void UpdateSize (Vector2 size)
 Sets the size of the widget container.
 
virtual void DetachWidget ()
 Detaches the widget from the widget container.
 
void ToggleLockedState ()
 Toggles the locked state of the widget container, which determines if the widget can be removed or added.
 
bool TryMove ()
 Tries to move the widget.
 

Protected Member Functions

virtual void Awake ()
 
void CreateBorder ()
 
virtual void Update ()
 

Protected Attributes

Widget widget
 
Vector2 size = Vector2.one
 
Material borderMaterial
 
LineRenderer border
 
bool locked
 

Properties

Widget Widget [get]
 
Vector2 Size [get]
 
float ScaleFactor [get]
 
LineRenderer Border [get]
 
bool HoverLeft [get]
 
bool HoverRight [get]
 
bool Hover [get]
 
bool Locked [get]
 

Events

static Action< WidgetContainerOnInit
 

Detailed Description

An object that can hold a widget. Allows the ability to move widgets around between various containers, and to lock the widget to prevent moving.

Member Function Documentation

◆ Awake()

virtual void FMAR.UI.Widgets.WidgetContainer.Awake ( )
inlineprotectedvirtual

Reimplemented in FMAR.UI.Widgets.Tab.

◆ CreateBorder()

void FMAR.UI.Widgets.WidgetContainer.CreateBorder ( )
inlineprotected

◆ DetachWidget()

virtual void FMAR.UI.Widgets.WidgetContainer.DetachWidget ( )
inlinevirtual

Detaches the widget from the widget container.

Reimplemented in FMAR.UI.Widgets.FloatingDisplay, FMAR.UI.Widgets.GridSlot, and FMAR.UI.Widgets.TabbedDisplaySlot.

◆ Init()

virtual WidgetContainer FMAR.UI.Widgets.WidgetContainer.Init ( Widget widget,
Vector2 size,
bool disableCollidersOverride = false,
float scaleFactor = -1,
bool disableInitEvent = false )
inlinevirtual

Initializes the widget container.

Parameters
widgetThe widget to place into the widget container.
sizeThe size of the widget container.
disableCollidersOverrideWhether to disable the colliders.
scaleFactorThe scale factor to use.
disableInitEventWhether to disable the init event.
Returns
This widget container.

Reimplemented in FMAR.UI.Widgets.GridSlot, and FMAR.UI.Widgets.TabbedDisplaySlot.

◆ ToggleLockedState()

void FMAR.UI.Widgets.WidgetContainer.ToggleLockedState ( )
inline

Toggles the locked state of the widget container, which determines if the widget can be removed or added.

◆ TryMove()

bool FMAR.UI.Widgets.WidgetContainer.TryMove ( )
inline

Tries to move the widget.

Returns
Whether or not the widget was moved. If the widget container is locked, will return false.

◆ Update()

virtual void FMAR.UI.Widgets.WidgetContainer.Update ( )
inlineprotectedvirtual

◆ UpdateSize()

void FMAR.UI.Widgets.WidgetContainer.UpdateSize ( Vector2 size)
inline

Sets the size of the widget container.

Parameters
sizeThe new size of the widget container.

Member Data Documentation

◆ border

LineRenderer FMAR.UI.Widgets.WidgetContainer.border
protected

◆ borderMaterial

Material FMAR.UI.Widgets.WidgetContainer.borderMaterial
protected

◆ locked

bool FMAR.UI.Widgets.WidgetContainer.locked
protected

◆ size

Vector2 FMAR.UI.Widgets.WidgetContainer.size = Vector2.one
protected

◆ widget

Widget FMAR.UI.Widgets.WidgetContainer.widget
protected

Property Documentation

◆ Border

LineRenderer FMAR.UI.Widgets.WidgetContainer.Border
get

◆ Hover

bool FMAR.UI.Widgets.WidgetContainer.Hover
get

◆ HoverLeft

bool FMAR.UI.Widgets.WidgetContainer.HoverLeft
get

◆ HoverRight

bool FMAR.UI.Widgets.WidgetContainer.HoverRight
get

◆ Locked

bool FMAR.UI.Widgets.WidgetContainer.Locked
get

◆ ScaleFactor

float FMAR.UI.Widgets.WidgetContainer.ScaleFactor
get

◆ Size

Vector2 FMAR.UI.Widgets.WidgetContainer.Size
get

◆ Widget

Widget FMAR.UI.Widgets.WidgetContainer.Widget
get

Event Documentation

◆ OnInit

Action<WidgetContainer> FMAR.UI.Widgets.WidgetContainer.OnInit
static

The documentation for this class was generated from the following file: