Merlin of Mines - Space Engineers

A set of useful scripts for aspiring Space Engineers!

View on GitHub

Display Block Handler

This handler is used to control diplays on any block containing one or more displays such as LCDs, Cockpits, Progammable Blocks, etc. You can write text to the screen, change the colors, change the script/images, and more.

Note that this block handler does not extend from Terminal Block, so this Block Handler does not have properties defined in Terminal Block Handler.

Default Primitive Properties:

Default Directional Properties

Note that there are no Display Block Group keywords. This is because individual blocks often have more than 1 display (Cockpits, Programmable Blocks). If you want to get all displays from a group of blocks, use "My Displays" group displays

“Name” Property

Prints the Display Name for the given display.

This property also enables you to get back all Display Names for a given block by doing:

Print "Display names: " + "My Programmable Block" display names

You can update a given block’s displays by named index using the display name, as follows:

#Keyboard
Print "My Program" display [1] name

set "My Program" display ["Keyboard"] text to "My Keyboard Text"

“Enabled” Property

Enables or Disables the given Display by setting the display’s content type to None (disabled) or TEXT_AND_IMAGES (enabled).

#Enable Block
enable "My Display"
set "My Display" to enabled
turn on "My Display"

#Disable Block
disable "My Display"
set "My Display" to disabled
turn off "My Display"

“Text” Property

Gets or Sets text on the display. When setting the display text, this property will automatically set the content type of the display to TEXT_AND_IMAGES.

Print "Display Text: " + "My Display" text

set "My Display" text to "Hello World!"
set "My Display" to "Hello World!"

“Image” Property

Gets/Sets the currently shown image on the display, if it exists. If there is no image currently being displayed, returns “”.

When setting the display image, this property will automatically set the content type of the display to TEXT_AND_IMAGES.

Print "Image: " + "My Display" image

set "My Display" image to "Construction"

See below for available images.

“Images” Property

Gets/Sets the set of images that are being displayed on the screen. Returns an empty list if there ar none.

When setting this property, each item in the list is expected to be a string representing one of the supported images. See the Image property for supported images.

When setting the display images, this property will automatically set the content type of the display to TEXT_AND_IMAGES.

Print "Selected Images: " + "My Display" images

set "My Display" images to ["Danger", "No Entry"]

Available Images:

“Script” Property

Gets/Sets the currently running script, if it exists. Returns “” otherwise.

When setting the display script, this property will automatically set the content type of the display to SCRIPT.

set "My Display" script to "TSS_ArtificialHorizon"

Available Scripts:

“Padding” Property

Gets/Sets the Text Padding for the given display.

Print "Padding: " + "My Display" padding

set "My Display" padding to 3

“Ratio” Property

Gets/Sets whether to preserve aspect ratio for images on this display block

if "My Displays" ratio is true
  Print "Preserving Aspect Ratio"

set "My Display" ratio to true

“Alignment” Property

Get/Sets the text alignment for the given display block.

When setting, if an unknown alignment is used, the alignment is set as “left”. Note that the type is String, please wrap the values in quotes so they aren’t incorrectly parsed.

set "My Display" alignement to "left"
set "My Display" alignment to "center"
set "My Display" alignment to "right"

Supported Values

“Size” Property

Gets/Sets the FontSize of the given display.

Print "Font Size: " + "My Display" size

set "My Display" size to 4

“Color” Property

If the display is in Script mode, Gets/Sets the Script Foreground color. Otherwise, Gets/Sets the Text Font Color.

set "My Display" color to green

“Background” Property

If the display is in Script mode, Gets/Sets the Script Background color. Otherwise, Gets/Sets the Text Background Color.

set "My Display" background to red

“Font” Property

When Getting this property, it returns the Font (“Debug”, etc) for the given display.

When setting this property, if the value is a String, will update the Font. If the value is numeric, will update the font size. If the value is a color, will update the font color.

#Font to "Debug"
set "My Display" font to "Debug"

#Font Size to 2
set "My Display" font to 2

#Font Color to red
set "My Display" font to red

Supported Fonts