Simulation Instruments

Home›All functions›Slider

Slider

Simulation Instrument Studio 1

slider_add_hor

Simulation Instrument Studio 1

Definition

slider_id = slider_add_hor(image, x, y, width, height, thumb_image, thumb_width, thumb_height, callback)

Remarks

Add a horizontal slider.

Example

No sample instrument calls this yet.

slider_add_hor()
Photo slot: shots/slider_add_hor.png

slider_add_ver

Simulation Instrument Studio 1

Definition

slider_id = slider_add_ver(image, x, y, width, height, thumb_image, thumb_width, thumb_height, callback)

Remarks

Add a vertical slider.

Example

No sample instrument calls this yet.

slider_add_ver()
Photo slot: shots/slider_add_ver.png

slider_add_cir

Simulation Instrument Studio 1

Definition

slider_id = slider_add_cir(image, x, y, width, height, radius, start_angle, end_angle, thumb_image, thumb_width, thumb_height, callback)

Remarks

Add a circular slider.

Example

No sample instrument calls this yet.

slider_add_cir()

Example: a stop, and an endless ring

-- Mixture. Travel is the bottom half, 90 to 270 degrees.
function on_mix(pos)
    xpl_dataref_write("sim/cockpit2/engine/actuators/mixture_ratio[0]", "FLOAT", pos)
end
mixture = slider_add_cir("ring.png", 20, 20, 160, 160, 70, 90, 270, "thumb.png", 16, 28, on_mix)

-- Heading bug. No end angle, so it keeps turning.
function on_bug(pos)
    rotate(bug, pos * 360)
end
bug = slider_add_cir("ring.png", 200, 20, 160, 160, 70, 0, nil, "thumb.png", 16, 28, on_bug)
Photo slot: shots/slider_add_cir.png

slider_set_position

Simulation Instrument Studio 1

Definition

slider_set_position(slider_id, position)

Remarks

Set the slider to a certain position.

Parameters

NameDescription
slider_idId returned by the call that created the object.
positionPosition from 0 to 1. 0 is one end, 1 is the other.

Example

No sample instrument calls this yet.

slider_set_position(slider_id, position)
Photo slot: shots/slider_set_position.png