-
Notifications
You must be signed in to change notification settings - Fork 3
Widget
Abstract class. The base for all widgets.
Parameters :
- parent:Frame - The Widget's parent
- x:number - x position relative to the parent
- y:number - y position relative to the parent
Return :
- Widget - a Widget instance
Return :
- Frame - The frame the widget is in
Getter and setter for the widget's position. If x and y are set, the position will be updated. Return the old or current position.
Parameters :
- x:number - x position relative to the parent
- y:number - y position relative to the parent
Return :
- x:number - the old x position relative to the parent
- y:number - the old y position relative to the parent
Getter and setter for the widget's x position. If x and is set, the position will be updated. Return the old or current position.
Parameters :
- x:number - x position relative to the parent
Return :
- x:number - the old x position relative to the parent
Getter and setter for the widget's y position. If y and is set, the position will be updated. Return the old or current position.
Parameters :
- y:number - y position relative to the parent
Return :
- y:number - the old y position relative to the parent
Getter and setter for the widget's z position. If z and is set, the position will be updated. Return the old or current position.
Parameters :
- z:number - z position relative to the parent
Return :
- z:number - the old z position relative to the parent
Get the widget absolute x position on screen.
Return :
- x:number - absolute x position on screen
Get the widget absolute y position on screen.
Return :
- y:number - absolute y position on screen
Get the widget absolute position on screen.
Return :
- x:number - absolute x position on screen
- y:number - absolute y position on screen
Getter and setter for the widget's width. If width and is set, the width will be updated. Return the old or current width.
Parameters :
- width:number - widget's width Return
- width:number - the widget's width
Getter and setter for the widget's width. If width and is set, the height will be updated. Return the old or current height.
Parameters :
- height:number - widget's height Return
- height:number - the widget's height
Getter and setter for the widget's size. If width and height are set, the size will be updated. Return the old or current size.
Parameters :
- width:number - width relative to the parent
- height:number - height relative to the parent
Return :
- width:number - the old width relative to the parent
- height:number - the old height relative to the parent
Getter and setter for the widget's visibility. If value is set, the visibility will be updated. Return the old or current visibility.
Parameters :
- value:boolean - new visible state Returns :
- visible:boolean - the widget's visibility state
Getter and setter for the widget's enabled state. If value is set, the enabled state will be updated. Return the old or current enabled state.
Parameters :
- value:boolean - new visible enabled state Returns :
- visible:boolean - the widget's enabled state
Getter and setter for the function called when the widget is interacted with with the mouse. Return the old or current callback function when no arguments are given
Parameters :
- callback:function -
func(self:Widget,...:any,eventsValues...:any) - ...:any - additional parameters to call the function with
Return :
- callback:function
- ...:table - the additional arguments passed to the function in a table.
Check if the given position is on the widget. The check is done against the absolute position. Parameters
- x:number - absolute x position on screen
- y:number - absolute y position on screen
Return :
- collide : boolean
Draw the widget on screen