πŸ–₯️ BaseWidget

BaseWidget is the base for all WGUI widget classes.

🦠 Functions


SetMouseEnabled

Sets whether or not the mouse should be enabled for this widget.

Widget:SetMouseEnabled(IsEnabled)
TypeParameterDescription

IsEnabled

GetMouseEnabled

Returns whether or not the mouse should be enabled for this widget.

β€” Returns boolean.

local ret = Widget:GetMouseEnabled()

SetKeyboardEnabled

Sets whether or not the keyboard should be enabled for this widget.

Widget:SetKeyboardEnabled(IsEnabled)
TypeParameterDescription

IsEnabled

GetKeyboardEnabled

Returns whether or not the keyboard should be enabled for this widget.

β€” Returns boolean.

local ret = Widget:GetKeyboardEnabled()

SetForceInputRules

Sets whether or not the widget should force the input rules to be recalculated no matter if it is visible or not.

Widget:SetForceInputRules(Force)
TypeParameterDescription

Force

GetForceInputRules

β€” Returns boolean.

local ret = Widget:GetForceInputRules()

SetTranslation

Sets the render translation of the widget.

Widget:SetTranslation(NewTranslation)
TypeParameterDescription

NewTranslation

GetTranslation

Gets the render translation of the widget.

β€” Returns Vector2D.

local ret = Widget:GetTranslation()

SetScale

Sets the scale of the widget.

Widget:SetScale(NewScale)
TypeParameterDescription

NewScale

GetScale

Gets the scale of the widget.

β€” Returns Vector2D.

local ret = Widget:GetScale()

GetDesiredSize

Returns the desired size of the widget.

β€” Returns Vector2D.

local ret = Widget:GetDesiredSize()

SetShear

Sets the shear of the widget.

Widget:SetShear(NewShear)
TypeParameterDescription

NewShear

GetShear

Gets the shear of the widget.

β€” Returns Vector2D.

local ret = Widget:GetShear()

SetAngle

Sets the angle of the widget.

Widget:SetAngle(NewAngle)
TypeParameterDescription

NewAngle

GetAngle

Gets the angle of the widget.

β€” Returns number.

local ret = Widget:GetAngle()

SetPivot

Sets the pivot of the widget.

Widget:SetPivot(NewPivot)
TypeParameterDescription

NewPivot

GetPivot

Gets the pivot of the widget.

β€” Returns Vector2D.

local ret = Widget:GetPivot()

SetOpacity

Sets the opacity of the widget.

Widget:SetOpacity(NewOpacity)
TypeParameterDescription

NewOpacity

GetOpacity

Gets the opacity of the widget.

β€” Returns number.

local ret = Widget:GetOpacity()

SetColor

Sets the tint of the widget, this affects all children.

Widget:SetColor(Color)
TypeParameterDescription

Color

GetColor

Gets the tint of the widget.

β€” Returns Color.

local ret = Widget:GetColor()

SetForegroundColor

Sets the foreground color of the widget.

Widget:SetForegroundColor(Color, ColorRule)
TypeParameterDescription

Color

ColorRule

CreateAnimationObject

β€” Returns AnimationObject.

local ret = Widget:CreateAnimationObject(
    GetterFunction,
    SetterFunction,
    EndValue,
    Duration,
    OnCompleted?,
    AutoDestroy?,
    EasingFunction?
)
TypeNameDefault

GetterFunction

SetterFunction

EndValue

Duration

OnCompleted?

AutoDestroy?

false

EasingFunction?

RemoveFromParent

Removes the widget from its parent panel.

Widget:RemoveFromParent()

GetParent

Returns the parent panel of the widget.

β€” Returns PanelWidget or nil.

local ret = Widget:GetParent()

IsChildOfParent

Returns whether the widget is a child of the specified parent class.

β€” Returns boolean.

local ret = Widget:IsChildOfParent(ParentClass)
TypeParameterDescription

ParentClass

SetVisibility

Sets the visibility of the widget.

Widget:SetVisibility(NewVisibility)
TypeParameterDescription

NewVisibility

GetVisibility

Gets the visibility of the widget.

β€” Returns WGUIVisibility.

local ret = widget:GetVisibility()

IsVisible

Returns true if the widget is currently visible.

β€” Returns boolean.

local ret = Widget:IsVisible()

IsHitTestable

Returns true if the widget can be interacted with.

β€” Returns boolean.

local ret = Widget:IsHitTestable()

IsHovered

Returns true if the widget is currently being hovered.

β€” Returns boolean.

local ret = Widget:IsHovered()

IsRendered

Returns true if the widget is currently rendered.

β€” Returns boolean.

local ret = Widget:IsRendered()

SetIsEnabled

Sets the current enabled status of the widget.

Widget:SetIsEnabled(IsEnabled)
TypeParameterDescription

IsEnabled

GetIsEnabled

Gets the current enabled status of the widget.

β€” Returns boolean.

local ret = Widget:GetIsEnabled()

SetPadding

Sets the padding of the widget, putting a larger gap between the widget border and it's root widget.

widget:SetPadding(Padding)
TypeParameterDescription

Padding

GetPadding

Gets the padding of the widget.

β€” Returns Margin.

local ret = widget:GetPadding()

SetToolTipText

Sets the tooltip text of the widget.

Widget:SetToolTipText(Text)
TypeParameterDescription

Text

GetToolTipText

Gets the tooltip text of the widget.

β€” Returns string.

local ret = Widget:GetToolTipText()

SetToolTipWidget

Sets the tooltip widget of the widget.

Widget:SetToolTipWidget(Widget)
TypeParameterDescription

Widget

GetToolTipWidget

Gets the tooltip widget of the widget.

β€” Returns Widget

local ret = Widget:GetToolTipWidget()

SetCursor

Sets the cursor to show over the widget.

widget:SetCursor(Cursor)
TypeParameterDescription

Cursor

GetCursor

Gets the cursor to show over the widget.

β€” Returns CursorType.

local ret = Widget:GetCursor()

SetClipping

Sets the clipping state of the widget.

widget:SetClipping(Clipping)
TypeParameterDescription

Clipping

GetClipping

Gets the clipping state of the widget.

β€” Returns WidgetClipping.

local ret = Widget:GetClipping()

SetSnapToPixel

Sets whether or not the widget will draw snapped to the nearest pixel.

Widget:SetSnapToPixel(PixelSnapping)
TypeParameterDescription

PixelSnapping

GetSnapToPixel

Gets whether or not the widget will draw snapped to the nearest pixel.

β€” Returns PixelSnapping.

local ret = Widget:GetSnapToPixel()

SetDragKey

Sets the input key that will be used to drag the widget.

Widget:SetDragKey(Key)
TypeParameterDescription

Key

GetDragKey

Gets the input key that will be used to drag the widget.

β€” Returns string.

local ret = Widget:GetDragKey()

CreateDragDropOperation

Creates a new drag & drop operation. Should be called inside a OnDragDetected event.

Widget:CreateDragDropOperation(DragVisual, Payload, MetaData, Pivot, Offset)
TypeParameterDescription

DragVisual

Payload

MetaData

Pivot

Offset

CancelDragDropOperation

Cancels any ongoing drag & drop operation.

Widget:CancelDragDropOperation()

GetIsDragDropping

Returns true if the widget is currently being dragged.

β€” Returns boolean.

local ret = Widget:GetIsDragDropping()

InvalidateLayoutAndVolatility

Invalidates the widget from the view of a layout caching widget that may own this widget. It will force the owning widget to redraw and cache children on the next paint pass.

Widget:InvalidateLayoutAndVolatility()

ForceVolatile

Sets the forced volatility of the widget.

Widget:ForceVolatile(bForce)
TypeParameterDescription

bForce

ForceLayoutPrepass

Forces a pre-pass. A pre-pass caches the desired size of the widget hierarchy owned by this widget.

Widget:ForceLayoutPrepass()

BindDispatcher

β€” Returns function (the subscribed callback itself).

local ret = Widget:BindDispatcher(EventName, Callback)
TypeParameterDescription

EventName

Callback

UnbindDispatcher

Widget:UnbindDispatcher(EventName, Callback?)
TypeParameterDescription

EventName

Callback?


πŸš€ Events

Mouse Button Down

Widget:BindDispatcher("MouseButtonDown", function(self, PointerEvent)
    -- Mouse Button Down was called
end)
TypeParameterDescription

PointerEvent

Mouse Button Up

Widget:BindDispatcher("MouseButtonUp", function(self, PointerEvent)
    -- Mouse Button Up was called
end)
TypeParameterDescription

PointerEvent

Mouse Move

Widget:BindDispatcher("MouseButtonMove", function(self, PointerEvent)
    -- Mouse Button Move was called
end)
TypeParameterDescription

PointerEvent

Mouse Enter

Widget:BindDispatcher("MouseEnter", function(self, PointerEvent)
    -- Mouse Enter was called
end)
TypeParameterDescription

PointerEvent

Mouse Leave

Widget:BindDispatcher("MouseLeave", function(self, PointerEvent)
    -- Mouse Leave was called
end)
TypeParameterDescription

PointerEvent

Mouse Wheel

Widget:BindDispatcher("MouseWheel", function(self, PointerEvent)
    -- Mouse Wheel was called
end)
TypeParameterDescription

PointerEvent

Mouse Double Click

Widget:BindDispatcher("MouseDoubleClick", function(self, PointerEvent)
    -- Mouse Double Click was called
end)
TypeParameterDescription

PointerEvent

Focus Received

Widget:BindDispatcher("FocusReceived", function()
    -- Focus Received was called
end)

Focus Lost

Widget:BindDispatcher("FocusLost", function()
    -- Focus Lost was called
end)

Drag Detected

Widget:BindDispatcher("DragDetected", function(self, PointerEvent)
    -- Drag Detected was called
end)
TypeParameterDescription

PointerEvent

Drag Cancelled

Widget:BindDispatcher("DragCancelled", function(self, PointerEvent)
    -- Drag Cancelled was called
end)
TypeParameterDescription

PayloadID

Tag

Drop

Widget:BindDispatcher("Drop", function(self, PayloadID, Tag)
    -- Drop was called
end)
TypeParameterDescription

PayloadID

Tag

Last updated