-
Notifications
You must be signed in to change notification settings - Fork 2
Sheet
The Sheet class is the base class for all UI components. Anything the user can interact with is either a Sheet or extends it.
Sheet( number x, number y, number width, number height )
Sheet:onParentResized()
Called when the Sheet's parent resizes.
Sheet:onMouseEvent( MouseEvent event )
Called when the Sheet gets a mouse event.
Sheet:onKeyboardEvent( KeyboardEvent event )
Called when the Sheet gets a keyboard event (and has the handlesKeyboard property).
Sheet:onTextEvent( TextEvent event )
Called when the Sheet gets a mouse event (and has the handlesText property).
Sheet:onUpdate( number dt )
Called when the Sheet updates.
Sheet:onPreDraw()
Called before the Sheet draws its children.
Sheet:onPostDraw()
Called after the Sheet draws its children.
Sheet.x - number
The X position of the Sheet, based at 0.
Sheet.y - number
The Y position of the Sheet, based at 0.
Sheet.z - number
The Z position of the Sheet, based at 0.
Sheet.id - string
The ID of the Sheet.
Sheet.style - Style
The unique Style of the Sheet.
Sheet.parent - nil, Sheet, or Screen
The Sheet's parent. See Object Structure Tutorial.
Sheet.canvas - DrawingCanvas
The canvas holding the Sheet's graphical content.
Sheet.changed - boolean
Whether the Sheet has changes to draw.
Sheet.handlesKeyboard - boolean
Whether the Sheet should get keyboard events.
Sheet.handlesText - boolean
Whether the Sheet should get text events.
Sheet.cursor_active - boolean
Whether the Sheet has its cursor blink enabled.
Sheet.cursor_colour - number
The colour of the cursor, if present.
Sheet.cursor_x - number
The X position of the cursor, if present.
Sheet.cursor_y - number
The Y position of the cursor, if present.
This method is chainable.
Sheet:setX( number x )
Sets the X position of the Sheet, and tells its parent to redraw.
This method is chainable.
Sheet:setY( number y )
Sets the Y position of the Sheet, and tells its parent to redraw.
This method is chainable.
Sheet:setZ( number z )
Sets the Z position of the Sheet, and tells its parent to redraw.
This method is chainable.
Sheet:setID( string id )
Sets the ID of the Sheet.
This method is chainable.
Sheet:setStyle( Style style, boolean children = false )
Sets the style of the Sheet, and of children sheets if children is true.
This method is chainable.
Sheet:setParent( Sheet/Screen/nil parent )
Sets the parent of the Sheet.
Sheet:remove()
Removes the Sheet from its parent, returning itself if had a parent to be removed from.
boolean visible = Sheet:isVisible()
Returns whether the Sheet is visible inside its parent's canvas (doesn't take overlapping elements into account).
This method is chainable.
Sheet:bringToFront()
Brings the Sheet in front of all other sheets with the same Z value and the same parent.
This method is chainable.
Sheet:setChanged( boolean state = true )
Tells the Sheet (and its parent) that it needs to redraw.
This method is chainable.
Sheet:setCursorBlink( number x, number y, number colour = WHITE )
Sets the Sheet's internal cursor blink, causing a redraw.
This method is chainable.
Sheet:resetCursorBlink()
Disables the Sheet's internal cursor blink, causing a redraw.
Sheet:update( number dt )
Updates the Sheet and its animations.
Sheet:draw()
Redraws the Sheet if it has changed.
Sheet:handle( Event event )
Passes an event to the Sheet.
- Exception
- DynamicValueException
- ExpressionException
- IncorrectConstructorException
- IncorrectParameterException
- ParserException
- ResourceLoadException
- ThreadRuntimeException