Simulation Instruments

Home›All functions›Node

Node

Simulation Instrument Studio 1

move

Simulation Instrument Studio 1

Definition

move(node_id, x, y, width, height)

Remarks

Move the node to the specified bounds.

Parameters

NameDescription
node_idId returned by the call that created the object.
xLeft position in instrument pixels.
yTop position in instrument pixels.
widthWidth in instrument pixels.
heightHeight in instrument pixels.

Example

No sample instrument calls this yet.

move(node_id, x, y, width, height)

Example: a jump, and a slide

-- Jump the flag. nil leaves width and height alone.
move(flag, 200, 40)

-- Ease it back. Later moves use this easing.
move(flag, nil, nil, nil, nil, "LOG", 0.3)
move(flag, 20, 40)
Photo slot: shots/move.png

visible

Simulation Instrument Studio 1

Definition

visible(node_id, visible)

Remarks

Makes a node visible or invisible.

Parameters

NameDescription
node_idId returned by the call that created the object.
visibleTrue to show, false to hide.

Example

No sample instrument calls this yet.

visible(node_id, visible)
Photo slot: shots/visible.png

opacity

Simulation Instrument Studio 1

Definition

opacity(node_id, opacity)

Remarks

Change the opacity (0.0 – 1.0).

Parameters

NameDescription
node_idId returned by the call that created the object.
opacityTop position in instrument pixels.

Example

No sample instrument calls this yet.

opacity(node_id, opacity)

Example: a jump, and a fade

opacity(face, 0.4)
opacity(face, nil, "LOG", 0.3)
opacity(face, 1.0)
Photo slot: shots/opacity.png

viewport_rect

Simulation Instrument Studio 1

Definition

viewport_rect(node_id, x, y, width, height)

Remarks

Only shows the node within a specified rectangle.

Parameters

NameDescription
node_idId returned by the call that created the object.
xLeft position in instrument pixels.
yTop position in instrument pixels.
widthWidth in instrument pixels.
heightHeight in instrument pixels.

Example

No sample instrument calls this yet.

viewport_rect(node_id, x, y, width, height)
Photo slot: shots/viewport_rect.png

viewport_shape

Simulation Instrument Studio 1

Definition

viewport_shape(node_id, draw_callback)

Remarks

Only shows the node within a specified shape.

Parameters

NameDescription
node_idId returned by the call that created the object.
draw_callbackFunction called when the value changes.

Example

No sample instrument calls this yet.

viewport_shape(node_id, function() end)
Photo slot: shots/viewport_shape.png

rotate

Simulation Instrument Studio 1

Overloads

rotate(node_id, degrees)
rotate(node_id, degrees, anchor_x, anchor_y, anchor_z)
rotate(node_id, degrees, animation_type, animation_speed)
rotate(node_id, degrees, animation_type, animation_speed, animation_direction)
rotate(node_id, degrees, anchor_x, anchor_y, anchor_z, animation_type, animation_speed, animation_direction)

Turns a node, or a group. The angle is in degrees, in instrument space. LINEAR and LOG ease to the new angle.

Parameters

#NameTypeDescription
1node_idIDFrom img_add, txt_add, or canvas_add.
2degreesNumberDegrees to rotate the object to.
3anchor_xNumberOptional. Rotate around this X coordinate, in instrument space.
4anchor_yNumberOptional. Rotate around this Y coordinate, in instrument space.
5anchor_zNumberOptional. Accepted. 2D instruments do not use it.
6animation_typeStringOptional. OFF, LINEAR, or LOG. Accepted. Animation is not applied yet.
7animation_speedFloatOptional. 1.0 fastest, 0.0 slowest.
8animation_directionStringOptional. DIRECT, CW, CCW, FASTEST, or SLOWEST.

Example

"cm">-- Load and display an image
face = "tok-fn">img_add_fullscreen("st">"face.png")

"cm">-- Rotate to 90 degrees, around the image center
"tok-fn">rotate(face, "nu">90)

"cm">-- 450 is the same angle as 90
"tok-fn">rotate(face, "nu">450)

Example: a jump, and a sweep

-- Jump the needle to 90
rotate(needle, 90)

-- Later turns take the short way, on a log curve
rotate(needle, nil, nil, nil, nil, nil, nil)
rotate(needle, 10, 120, 120, nil, "LOG", 0.5, "FASTEST")

remove

Simulation Instrument Studio 1

Definition

remove(image_id)

Remarks

Remove the image from the instrument.

Parameters

NameDescription
image_idImage id returned by an earlier img_ or canvas call.

Example

No sample instrument calls this yet.

remove(image_id)
Photo slot: shots/remove.png