Table of Contents

Class Widget

Namespace
TaleWorlds.GauntletUI.BaseTypes
Assembly
TaleWorlds.GauntletUI.dll
public class Widget : PropertyOwnerObject
Inheritance
Widget
Derived
Inherited Members
Extension Methods

Constructors

Widget(UIContext)

public Widget(UIContext context)

Parameters

context UIContext

Fields

AcceptDropHandler

public Func<Widget, Widget, bool> AcceptDropHandler

Field Value

Func<Widget, Widget, bool>

OnGamepadNavigationFocusGained

public Action<Widget> OnGamepadNavigationFocusGained

Field Value

Action<Widget>

_cachedGlobalPosition

protected Vector2 _cachedGlobalPosition

Field Value

Vector2

_calculateSizeFirstFrame

protected bool _calculateSizeFirstFrame

Field Value

bool

_currentVisualStateAnimationState

protected VisualStateAnimationState _currentVisualStateAnimationState

Field Value

VisualStateAnimationState

_gamepadNavigationIndex

protected int _gamepadNavigationIndex

Field Value

int

_seed

protected int _seed

Field Value

int

_startVisualState

protected VisualState _startVisualState

Field Value

VisualState

_stateTimer

protected float _stateTimer

Field Value

float

Properties

AcceptDrag

[Editor(false)]
public bool AcceptDrag { get; set; }

Property Value

bool

AcceptDrop

[Editor(false)]
public bool AcceptDrop { get; set; }

Property Value

bool

AcceptNavigation

public bool AcceptNavigation { get; set; }

Property Value

bool

AllChildren

public IEnumerable<Widget> AllChildren { get; }

Property Value

IEnumerable<Widget>

AllChildrenAndThis

public IEnumerable<Widget> AllChildrenAndThis { get; }

Property Value

IEnumerable<Widget>

AlphaFactor

public float AlphaFactor { get; set; }

Property Value

float

AlternateClickEventHasSpecialEvent

[Editor(false)]
public bool AlternateClickEventHasSpecialEvent { get; set; }

Property Value

bool

Bottom

public float Bottom { get; }

Property Value

float

CanAcceptEvents

[Editor(false)]
public bool CanAcceptEvents { get; set; }

Property Value

bool

ChildCount

public int ChildCount { get; }

Property Value

int

Children

public List<Widget> Children { get; }

Property Value

List<Widget>

CircularClipEnabled

[Editor(false)]
public bool CircularClipEnabled { get; set; }

Property Value

bool

CircularClipRadius

[Editor(false)]
public float CircularClipRadius { get; set; }

Property Value

float

CircularClipSmoothingRadius

[Editor(false)]
public float CircularClipSmoothingRadius { get; set; }

Property Value

float

CircularClipXOffset

[Editor(false)]
public float CircularClipXOffset { get; set; }

Property Value

float

CircularClipYOffset

[Editor(false)]
public float CircularClipYOffset { get; set; }

Property Value

float

ClipContents

[Editor(false)]
public bool ClipContents { get; set; }

Property Value

bool

ClipHorizontalContent

[Editor(false)]
public bool ClipHorizontalContent { get; set; }

Property Value

bool

ClipVerticalContent

[Editor(false)]
public bool ClipVerticalContent { get; set; }

Property Value

bool

Color

public Color Color { get; set; }

Property Value

Color

ColorFactor

public float ColorFactor { get; set; }

Property Value

float

Context

public UIContext Context { get; }

Property Value

UIContext

CurrentState

public string CurrentState { get; protected set; }

Property Value

string

CursorAreaXOffset

public float CursorAreaXOffset { get; set; }

Property Value

float

CursorAreaYOffset

public float CursorAreaYOffset { get; set; }

Property Value

float

DisableRender

public bool DisableRender { get; set; }

Property Value

bool

DoNotAcceptEvents

[Editor(false)]
public bool DoNotAcceptEvents { get; set; }

Property Value

bool

DoNotAcceptNavigation

public bool DoNotAcceptNavigation { get; set; }

Property Value

bool

DoNotPassEventsToChildren

[Editor(false)]
public bool DoNotPassEventsToChildren { get; set; }

Property Value

bool

DoNotRenderIfNotFullyInsideScissor

[Editor(false)]
public bool DoNotRenderIfNotFullyInsideScissor { get; set; }

Property Value

bool

DoNotUseCustomScale

public bool DoNotUseCustomScale { get; set; }

Property Value

bool

DoNotUseCustomScaleAndChildren

[Editor(false)]
public bool DoNotUseCustomScaleAndChildren { get; set; }

Property Value

bool

DragWidget

[Editor(false)]
public Widget DragWidget { get; set; }

Property Value

Widget

DropEventHandledManually

[Editor(false)]
public bool DropEventHandledManually { get; set; }

Property Value

bool

EventManager

public EventManager EventManager { get; }

Property Value

EventManager

ExtendBottom

public float ExtendBottom { get; set; }

Property Value

float

ExtendCursorAreaBottom

public float ExtendCursorAreaBottom { get; set; }

Property Value

float

ExtendCursorAreaLeft

public float ExtendCursorAreaLeft { get; set; }

Property Value

float

ExtendCursorAreaRight

public float ExtendCursorAreaRight { get; set; }

Property Value

float

ExtendCursorAreaTop

public float ExtendCursorAreaTop { get; set; }

Property Value

float

ExtendLeft

public float ExtendLeft { get; set; }

Property Value

float

ExtendRight

public float ExtendRight { get; set; }

Property Value

float

ExtendTop

public float ExtendTop { get; set; }

Property Value

float

FixedHeight

public bool FixedHeight { get; }

Property Value

bool

FixedWidth

public bool FixedWidth { get; }

Property Value

bool

ForcePixelPerfectRenderPlacement

[Editor(false)]
public bool ForcePixelPerfectRenderPlacement { get; set; }

Property Value

bool

FrictionEnabled

public bool FrictionEnabled { get; set; }

Property Value

bool

GamepadNavigationContext

public IGamepadNavigationContext GamepadNavigationContext { get; }

Property Value

IGamepadNavigationContext

GamepadNavigationIndex

public int GamepadNavigationIndex { get; set; }

Property Value

int

GlobalPosition

public Vector2 GlobalPosition { get; }

Property Value

Vector2

HeightSizePolicy

[Editor(false)]
public SizePolicy HeightSizePolicy { get; set; }

Property Value

SizePolicy

HideOnDrag

[Editor(false)]
public bool HideOnDrag { get; set; }

Property Value

bool

HorizontalAlignment

[Editor(false)]
public HorizontalAlignment HorizontalAlignment { get; set; }

Property Value

HorizontalAlignment

HorizontalFlip

public bool HorizontalFlip { get; set; }

Property Value

bool

HoveredCursorState

[Editor(false)]
public string HoveredCursorState { get; set; }

Property Value

string

Id

[Editor(false)]
public string Id { get; set; }

Property Value

string

IsCircularClipRadiusHalfOfHeight

[Editor(false)]
public bool IsCircularClipRadiusHalfOfHeight { get; set; }

Property Value

bool

IsCircularClipRadiusHalfOfWidth

[Editor(false)]
public bool IsCircularClipRadiusHalfOfWidth { get; set; }

Property Value

bool

IsDisabled

[Editor(false)]
public bool IsDisabled { get; set; }

Property Value

bool

IsEnabled

[Editor(false)]
public bool IsEnabled { get; set; }

Property Value

bool

IsFocusable

[Editor(false)]
public bool IsFocusable { get; set; }

Property Value

bool

IsFocused

public bool IsFocused { get; }

Property Value

bool

IsHidden

[Editor(false)]
public bool IsHidden { get; set; }

Property Value

bool

IsHovered

public bool IsHovered { get; }

Property Value

bool

IsPressed

public bool IsPressed { get; }

Property Value

bool

IsUsingNavigation

public bool IsUsingNavigation { get; set; }

Property Value

bool

IsVisible

[Editor(false)]
public bool IsVisible { get; set; }

Property Value

bool

LayoutImp

public ILayout LayoutImp { get; protected set; }

Property Value

ILayout

Left

public float Left { get; }

Property Value

float

LocalPosition

public Vector2 LocalPosition { get; }

Property Value

Vector2

MarginBottom

[Editor(false)]
public float MarginBottom { get; set; }

Property Value

float

MarginLeft

[Editor(false)]
public float MarginLeft { get; set; }

Property Value

float

MarginRight

[Editor(false)]
public float MarginRight { get; set; }

Property Value

float

MarginTop

[Editor(false)]
public float MarginTop { get; set; }

Property Value

float

MaxHeight

[Editor(false)]
public float MaxHeight { get; set; }

Property Value

float

MaxWidth

[Editor(false)]
public float MaxWidth { get; set; }

Property Value

float

MeasuredSize

public Vector2 MeasuredSize { get; }

Property Value

Vector2

MinHeight

[Editor(false)]
public float MinHeight { get; set; }

Property Value

float

MinWidth

[Editor(false)]
public float MinWidth { get; set; }

Property Value

float

ParentWidget

public Widget ParentWidget { get; set; }

Property Value

Widget

Parents

public IEnumerable<Widget> Parents { get; }

Property Value

IEnumerable<Widget>

PosOffset

public Vector2 PosOffset { get; set; }

Property Value

Vector2

PositionXOffset

[Editor(false)]
public float PositionXOffset { get; set; }

Property Value

float

PositionYOffset

[Editor(false)]
public float PositionYOffset { get; set; }

Property Value

float

RenderLate

[Editor(false)]
public bool RenderLate { get; set; }

Property Value

bool

RestartAnimationFirstFrame

[Editor(false)]
public bool RestartAnimationFirstFrame { get; set; }

Property Value

bool

Right

public float Right { get; }

Property Value

float

SaturationFactor

public float SaturationFactor { get; set; }

Property Value

float

ScaledMarginBottom

public float ScaledMarginBottom { get; }

Property Value

float

ScaledMarginLeft

public float ScaledMarginLeft { get; }

Property Value

float

ScaledMarginRight

public float ScaledMarginRight { get; }

Property Value

float

ScaledMarginTop

public float ScaledMarginTop { get; }

Property Value

float

ScaledMaxHeight

public float ScaledMaxHeight { get; }

Property Value

float

ScaledMaxWidth

public float ScaledMaxWidth { get; }

Property Value

float

ScaledMinHeight

public float ScaledMinHeight { get; }

Property Value

float

ScaledMinWidth

public float ScaledMinWidth { get; }

Property Value

float

ScaledPositionOffset

public Vector2 ScaledPositionOffset { get; }

Property Value

Vector2

ScaledPositionXOffset

public float ScaledPositionXOffset { get; set; }

Property Value

float

ScaledPositionYOffset

public float ScaledPositionYOffset { get; set; }

Property Value

float

ScaledSuggestedHeight

public float ScaledSuggestedHeight { get; set; }

Property Value

float

ScaledSuggestedWidth

public float ScaledSuggestedWidth { get; set; }

Property Value

float

Size

public Vector2 Size { get; }

Property Value

Vector2

Sprite

[Editor(false)]
public Sprite Sprite { get; set; }

Property Value

Sprite

SuggestedHeight

[Editor(false)]
public float SuggestedHeight { get; set; }

Property Value

float

SuggestedWidth

[Editor(false)]
public float SuggestedWidth { get; set; }

Property Value

float

Tag

public object Tag { get; set; }

Property Value

object

Top

public float Top { get; }

Property Value

float

TweenPosition

[Editor(false)]
public bool TweenPosition { get; set; }

Property Value

bool

UpdateChildrenStates

[Editor(false)]
public bool UpdateChildrenStates { get; set; }

Property Value

bool

UseGlobalTimeForAnimation

public bool UseGlobalTimeForAnimation { get; set; }

Property Value

bool

UseSiblingIndexForNavigation

public bool UseSiblingIndexForNavigation { get; set; }

Property Value

bool

UsedNavigationMovements

public GamepadNavigationTypes UsedNavigationMovements { get; set; }

Property Value

GamepadNavigationTypes

ValueFactor

public float ValueFactor { get; set; }

Property Value

float

VerticalAlignment

[Editor(false)]
public VerticalAlignment VerticalAlignment { get; set; }

Property Value

VerticalAlignment

VerticalFlip

public bool VerticalFlip { get; set; }

Property Value

bool

VisualDefinition

[Editor(false)]
public VisualDefinition VisualDefinition { get; set; }

Property Value

VisualDefinition

WidthSizePolicy

[Editor(false)]
public SizePolicy WidthSizePolicy { get; set; }

Property Value

SizePolicy

_inverseScaleToUse

protected float _inverseScaleToUse { get; }

Property Value

float

_scaleToUse

protected float _scaleToUse { get; }

Property Value

float

Methods

AddChild(Widget)

public void AddChild(Widget widget)

Parameters

widget Widget

AddChildAtIndex(Widget, int)

public void AddChildAtIndex(Widget widget, int index)

Parameters

widget Widget
index int

AddComponent(WidgetComponent)

public void AddComponent(WidgetComponent component)

Parameters

component WidgetComponent

AddState(string)

public void AddState(string stateName)

Parameters

stateName string

ApplyActionOnAllChildren(Action<Widget>)

public void ApplyActionOnAllChildren(Action<Widget> action)

Parameters

action Action<Widget>

CheckIsMyChildRecursive(Widget)

public bool CheckIsMyChildRecursive(Widget child)

Parameters

child Widget

Returns

bool

ContainsState(string)

public bool ContainsState(string stateName)

Parameters

stateName string

Returns

bool

EventFired(string, params object[])

protected void EventFired(string eventName, params object[] args)

Parameters

eventName string
args object[]

FindChild(string)

public Widget FindChild(string singlePathNode)

Parameters

singlePathNode string

Returns

Widget

FindChild(string, bool)

public Widget FindChild(string id, bool includeAllChildren = false)

Parameters

id string
includeAllChildren bool

Returns

Widget

FindChild(WidgetSearchDelegate)

public Widget FindChild(WidgetSearchDelegate widgetSearchDelegate)

Parameters

widgetSearchDelegate WidgetSearchDelegate

Returns

Widget

FindChild(BindingPath)

public Widget FindChild(BindingPath path)

Parameters

path BindingPath

Returns

Widget

GetChild(int)

public Widget GetChild(int i)

Parameters

i int

Returns

Widget

GetChildIndex(Widget)

public int GetChildIndex(Widget child)

Parameters

child Widget

Returns

int

GetComponent<T>()

public T GetComponent<T>() where T : WidgetComponent

Returns

T

Type Parameters

T

GetFilterChildIndex(Widget, Func<Widget, bool>)

public int GetFilterChildIndex(Widget child, Func<Widget, bool> childrenFilter)

Parameters

child Widget
childrenFilter Func<Widget, bool>

Returns

int

GetLocalPoint(Vector2)

public Vector2 GetLocalPoint(Vector2 globalPoint)

Parameters

globalPoint Vector2

Returns

Vector2

GetSiblingIndex()

public int GetSiblingIndex()

Returns

int

GetVisibleChildIndex(Widget)

public int GetVisibleChildIndex(Widget child)

Parameters

child Widget

Returns

int

GetVisibleSiblingIndex()

public int GetVisibleSiblingIndex()

Returns

int

HandleInput(IReadOnlyList<int>)

public virtual void HandleInput(IReadOnlyList<int> lastKeysPressed)

Parameters

lastKeysPressed IReadOnlyList<int>

HasChild(Widget)

public bool HasChild(Widget widget)

Parameters

widget Widget

Returns

bool

Hide()

public void Hide()

IsPointInsideGamepadCursorArea(Vector2)

public bool IsPointInsideGamepadCursorArea(Vector2 p)

Parameters

p Vector2

Returns

bool

IsPointInsideMeasuredArea(Vector2)

public bool IsPointInsideMeasuredArea(Vector2 p)

Parameters

p Vector2

Returns

bool

IsRecursivelyVisible()

public bool IsRecursivelyVisible()

Returns

bool

Layout(float, float, float, float)

public void Layout(float left, float bottom, float right, float top)

Parameters

left float
bottom float
right float
top float

Measure(Vector2)

public void Measure(Vector2 measureSpec)

Parameters

measureSpec Vector2

OnAfterChildRemoved(Widget)

protected virtual void OnAfterChildRemoved(Widget child)

Parameters

child Widget

OnBeforeRemovedChild(Widget)

public virtual void OnBeforeRemovedChild(Widget widget)

Parameters

widget Widget

OnChildAdded(Widget)

protected virtual void OnChildAdded(Widget child)

Parameters

child Widget

OnChildRemoved(Widget)

protected virtual void OnChildRemoved(Widget child)

Parameters

child Widget

OnConnectedToRoot()

protected virtual void OnConnectedToRoot()

OnDisconnectedFromRoot()

protected virtual void OnDisconnectedFromRoot()

OnDragBegin()

protected virtual void OnDragBegin()

OnDragEnd()

protected virtual void OnDragEnd()

OnDragHoverBegin()

protected virtual void OnDragHoverBegin()

OnDragHoverEnd()

protected virtual void OnDragHoverEnd()

OnDrop()

protected virtual bool OnDrop()

Returns

bool

OnGainFocus()

protected virtual void OnGainFocus()

OnGamepadNavigationFocusGain()

public void OnGamepadNavigationFocusGain()

OnGamepadNavigationIndexUpdated(int)

protected virtual void OnGamepadNavigationIndexUpdated(int newIndex)

Parameters

newIndex int

OnHoverBegin()

protected virtual void OnHoverBegin()

OnHoverEnd()

protected virtual void OnHoverEnd()

OnLateUpdate(float)

protected virtual void OnLateUpdate(float dt)

Parameters

dt float

OnLoseFocus()

protected virtual void OnLoseFocus()

OnMouseAlternatePressed()

protected virtual void OnMouseAlternatePressed()

OnMouseAlternateReleased()

protected virtual void OnMouseAlternateReleased()

OnMouseMove()

protected virtual void OnMouseMove()

OnMouseOverBegin()

protected virtual void OnMouseOverBegin()

OnMouseOverEnd()

protected virtual void OnMouseOverEnd()

OnMousePressed()

protected virtual void OnMousePressed()

OnMouseReleased()

protected virtual void OnMouseReleased()

OnMouseScroll()

protected virtual void OnMouseScroll()

OnParallelUpdate(float)

protected virtual void OnParallelUpdate(float dt)

Parameters

dt float

OnPreviewDragBegin()

protected virtual bool OnPreviewDragBegin()

Returns

bool

OnPreviewDragEnd()

protected virtual bool OnPreviewDragEnd()

Returns

bool

OnPreviewDragHover()

protected virtual bool OnPreviewDragHover()

Returns

bool

OnPreviewDrop()

protected virtual bool OnPreviewDrop()

Returns

bool

OnPreviewMouseAlternatePressed()

protected virtual bool OnPreviewMouseAlternatePressed()

Returns

bool

OnPreviewMouseAlternateReleased()

protected virtual bool OnPreviewMouseAlternateReleased()

Returns

bool

OnPreviewMouseMove()

protected virtual bool OnPreviewMouseMove()

Returns

bool

OnPreviewMousePressed()

protected virtual bool OnPreviewMousePressed()

Returns

bool

OnPreviewMouseReleased()

protected virtual bool OnPreviewMouseReleased()

Returns

bool

OnPreviewMouseScroll()

protected virtual bool OnPreviewMouseScroll()

Returns

bool

OnPreviewRightStickMovement()

protected virtual bool OnPreviewRightStickMovement()

Returns

bool

OnRender(TwoDimensionContext, TwoDimensionDrawContext)

protected virtual void OnRender(TwoDimensionContext twoDimensionContext, TwoDimensionDrawContext drawContext)

Parameters

twoDimensionContext TwoDimensionContext
drawContext TwoDimensionDrawContext

OnRightStickMovement()

protected virtual void OnRightStickMovement()

OnUpdate(float)

protected virtual void OnUpdate(float dt)

Parameters

dt float

RefreshState()

protected virtual void RefreshState()

RemoveAllChildren()

public void RemoveAllChildren()

RemoveChild(Widget)

public void RemoveChild(Widget widget)

Parameters

widget Widget

Render(TwoDimensionContext, TwoDimensionDrawContext)

public void Render(TwoDimensionContext twoDimensionContext, TwoDimensionDrawContext drawContext)

Parameters

twoDimensionContext TwoDimensionContext
drawContext TwoDimensionDrawContext

SetLayoutDirty()

protected void SetLayoutDirty()

SetMeasureAndLayoutDirty()

protected void SetMeasureAndLayoutDirty()

SetMeasureDirty()

protected void SetMeasureDirty()

SetSiblingIndex(int, bool)

public void SetSiblingIndex(int index, bool force = false)

Parameters

index int
force bool

SetState(string)

public virtual void SetState(string stateName)

Parameters

stateName string

Show()

public void Show()

SwapChildren(Widget, Widget)

public void SwapChildren(Widget widget1, Widget widget2)

Parameters

widget1 Widget
widget2 Widget

ToString()

public override string ToString()

Returns

string

UpdateAnimationPropertiesSubTask(float)

public virtual void UpdateAnimationPropertiesSubTask(float alphaFactor)

Parameters

alphaFactor float

UpdateBrushes(float)

public virtual void UpdateBrushes(float dt)

Parameters

dt float

Events

EventFire

public event Action<Widget, string, object[]> EventFire

Event Type

Action<Widget, string, object[]>

OnVisibilityChanged

public event Action<Widget> OnVisibilityChanged

Event Type

Action<Widget>

This page was last modified at 09/01/2024 16:12:00 +00:00 (UTC).