Skip to content
Benedict Allen edited this page Nov 15, 2015 · 6 revisions

Screen class.

The Screen class is used for managing the display of elements onto various screens. Each screen has child nodes, which are drawn to a number of terminals.

Constructor

Screen( Application application, number width, number height )

Note, this is done internally when done with Application:addScreen().

Implements

Variables

canvas

Screen.canvas - ScreenCanvas

The canvas of the screen which will be drawn to the terminals of the screen.

changed

Screen.changed - boolean

Whether the Screen has changes to be drawn.

parent

Screen.parent - Application

The parent Application of the screen.

Methods

setChanged()

This method is chainable.

Screen:setChanged( boolean state = true )

Tells the Screen it has changes to be drawn. state defaults to true if not given.

addMonitor()

This method is chainable.

Screen:addMonitor( string side )

Adds a monitor on the side given to the screen. This will throw an IncorrectParameterException if the side passed is not a monitor.

removeMonitor()

This method is chainable.

Screen:removeMonitor( string side )

Removes a monitor from the side given. This will not error if the side isn't currently added.

usesMonitor()

boolean uses = Screen:usesMonitor( string side )

Returns whether the Screen draws to a monitor on the side given.

addTerminal()

This method is chainable.

Screen:addTerminal( table t )

Adds a terminal redirect to the screen's terminals. The terminal will be drawn to.

removeTerminal()

This method is chainable.

Screen:removeTerminal( table t )

Removes a terminal from the screen's terminals. The terminal will no longer be drawn to.

draw()

Internal.

Screen:draw()

Draws changes to terminals.

handle()

Screen:handle( Event event )

Passes the event to child elements of the screen.

update()

Screen:update( number dt )

Updates the child elements of the screen.

Clone this wiki locally