Skip to content

Switch tile

$object.switchtile:description$

Properties

color_off

$object.switchtile.color_off:description$

color_on

$object.switchtile.color_on:description$

id

Unique object identifier. Each object in Traintastic has a globally unique id that can be used in scripts (see world.get_object).

text

$object.switchtile.text:description$

text_color_off

$object.switchtile.text_color_off:description$

text_color_on

$object.switchtile.text_color_on:description$

value

$object.switchtile.value:description$

Methods

set_value(value)

$object.switchtile.set_value:description$

Parameters:

  • value
    $object.switchtile.set_value.parameter.value:description$

toggle()

$object.switchtile.toggle:description$

Events

on_value_changed

$object.switchtile.on_value_changed:description$

Handler signature

function (switch, value, user_data)

Arguments

  • switch - $object.switchtile.on_value_changed.parameter.switch:description$

  • value - $object.switchtile.on_value_changed.parameter.value:description$

  • user_data - optional user-provided value (see Events).