Description
This component is provided by screen blocks (either when placed in the world or when installed in a robot).
Component name: screen.
This component is provided by screen blocks (either when placed in the world or when installed in a robot).
Component name: screen.
isOn():boolean Returns whether the screen is currently on.
turnOn():boolean Turns the screen on. Returns true if it was off.
turnOff():boolean Turns off the screen. Returns true if it was on.
getAspectRatio():number, number The aspect ratio of the screen. For multi-block screens this is the number of blocks, horizontal and vertical.
getKeyboards():table The list of keyboards attached to the screen.
setTouchModeInverted(enabled:boolean):boolean Sets Inverted Touch mode (Sneak-activate opens GUI if set to true).
isTouchModeInverted():boolean Check to see if Inverted Touch mode is enabled (Sneak-activate opens GUI is set to true).
setPrecise(enabled:boolean):boolean Set whether to use high-precision mode (sub-pixel mouse event position).
isPrecise():boolean Check whether high-precision mode is enabled (sub-pixel mouse event position).
screen_resized(screenAddress: string, newWidth: number, newHeight: number)
This signal is queued by screens when their resolution changes, for example because it was manually set via a GPU.
screenAddress The address of the screen.
newWidth The new width of the screen.
newHeight The new height of the screen.
touch(screenAddress: string, x: number, y: number, button: number, playerName: string)
This signal is queued by screens of tier two and tier three when they are clicked. This includes left clicks in the GUI (i.e. when a keyboard is attached) or when right-clicking/activating them in the world directly (i.e. when no keyboard is attached or when sneak-activating).
screenAddress The address of the screen.
x The x position of the click.
y The y position of the click.
button The button that was clicked. 0 for left, 1 for right.
playerName The name of the player that clicked the screen.
drag(screenAddress: string, x: number, y: number, button: number, playerName: string)
This signal is almost equivalent to the touch signal. The only difference is the implicit meaning: when this signal is fired, it “belongs” to a touch signal that was fired earlier. This can only be triggered by dragging in the GUI.
screenAddress is the address of the screen that was clicked.
x is the x coordinate of the click, in pixels.
y is the y coordinate of the click, in pixels.
button is the mouse's button that was clicked.
playerName is the name of the player that clicked the screen.
drop(screenAddress: string, x: number, y: number, button: number, playerName: string)
This signal is triggered when the player releases the mouse button after a touch signal. Despite the name, it does not necessarily follow a drag signal.
screenAddress is the address of the screen that was clicked.
x is the x coordinate of the click, in pixels.
y is the y coordinate of the click, in pixels.
button is the mouse's button that was clicked.
playerName is the name of the player that clicked the screen.
scroll(screenAddress: string, x: number, y: number, direction: number, playerName: string)
This signal is queued by screens of tier two and tier three when the player uses the mouse wheel in the GUI.
screenAddress is the address of the screen that was clicked.
x is the x coordinate of cursor location when the scroll occurred, in pixels.
y is the y coordinate of cursor location when the scroll occurred, in pixels.
direction is the direction of the scroll.
playerName is the name of the player that clicked the screen.
walk(screenAddress: string, x: number, y: number[, playerName: string])
This signal is queued by screens of tier two and tier three when a player or other entity walks on them.
screenAddress is the address of the screen that was clicked.
x is the x coordinate of the sub-block of the multi-block screen that queued the event
y is the y coordinate of the sub-block of the multi-block screen that queued the event
playerName is the name of the player that walked on the screen.