-
Notifications
You must be signed in to change notification settings - Fork 5
Environment Observables
Whilst you can create many of your own observables, there are a lot of observables already available in the environment that give you access and control over input, output and configuration. This page documents the most significant observables that you are likely to find useful in developing models in JS-Eden.
In the observables listed below, * and and square brackets indicate some custom changeable part of the observable name depending on what is available in your copy of the environment.
Each window on the screen, called a view, has many observables to control its position, size and appearance. Some observables are common to all views, and others are specific to the type of view. Note that [name] refers to the view/windows name.
-
_view_[name]_title- Set the string for the dialogs title -
_view_[name]_x- X-Coordinate of window -
_view_[name]_y- Y-Coordinate of window -
_view_[name]_width- Width of window -
_view_[name]_height- Height of window -
_view_[name]_type- The kind of view this dialog is. _view_[name]_visibility
-
_view_[name]_agent- The currently displayed tab. This can be changed. -
_view_[name]_showtabs- Boolean of whether to display agent tabs of not. -
_view_[name]_script- A string or list of strings and symbol pointers that act as the script contents. -
_view_[name]_file- A file to load the content from. -
_view_[name]_override- Deprecated. -
_view_[name]_next- Deprecated. -
_view_[name]_prev- Deprecated. -
_view_[name]_showbuttons- Boolean to show bottom button bar or not. -
_view_[name]_tabs- A list of all the open tabs. Can be changed. -
_view_[name]_zoom- Increase or decrease font size, default is 1.
-
_view_[name]_observable- The name of the observable containing the picture contents. _view_[name]_background_colour_view_[name]_zoom_view_[name]_canvas_right_view_[name]_canvas_bottom
_view_[name]_search_lang
mouseDownZone-
mouseButton- Name of mouse button being pressed. -
mouseButtons- Which mouse buttons are being pressed. mouseCapturemouseCaptured-
mouseContextMenuEnabled- Allow right click context menu on a canvas mouseDoubleClicks-
mouseDown- Point object containing location of mouse click. -
mouseDownView- The name of the dialog where the mouse was clicked. mouseFollow-
mousePosition- Point object containing current mouse position. -
mousePressed- Boolean of whether the mouse is pressed. -
mouseUp- Point object containing location of mouse release. mouseWheelmouseWheelEnabledmouseWheelSpeedmouseView-
mouseX- Current X-Coordinate of mouse. -
mouseY- Current Y-Coordinate of mouse. mouseZone
Only when the keyboard plugin is loaded, and the observables are only created after the key is pressed for the first time. Note that * is the key letter (capital) or digit number.
key_pressed_Key*key_pressed_Digit*key_pressed_ArrowLeftkey_pressed_ArrowRightkey_pressed_ArrowDownkey_pressed_ArrowUp
After importing plugins/network and/or plugins/arduino the following observables become available.
-
network_connected- A boolean set by the environment to indicate connection status -
network_address- The host name or IP to connect to -
network_port- Port number -
network_key- Session key -
network_connect- When set to true it will attempt to connect to the specified address and port -
network_error- Set by the system when an error occurs
-
arduino_connected- A boolean set to true when an arduino devices has been connected -
arduino_d*- Where * is 0-13. These are the digital pins, you can write booleans or numbers between 0-255, or read boolean values if that pin is set as an input -
arduino_a*- Where * is 0-5. These can be read with values between 0-1023 if these analog inputs are enabled -
arduino_input_d*- Set a digital pin to be an input -
arduino_enabled_a*- Enable an analog pin -
arduino_tone- Allow one digital pin to be a tone, set this to the pin number -
arduino_servo_d9- Make digital pin 9 a servo