Mouse setting

From Sim Innovations Wiki
Jump to navigation Jump to search

Description

mouse_setting(node_id,property,value) 

mouse_setting is used to configure mouse settings for dials, buttons or switches.

Return value

This function won't return any value.

Arguments

# Argument Type Description
1 node_id ID Node identifier. This can be obtained by calling functions like dial_add or switch_add.
2 property String Setting property.
3 value Object The value to set for the property. The type of value depends on the chosen property.

Properties

# Property Type Applies to Default Description
1 CURSOR String Button, Switch None Set custom cursor image when user is hovering over a button or a 2 position switch. This image must be 32x32 32-bit PNG file.
2 CURSOR_LEFT String Dial, Switch None Set custom cursor image when user is hovering over the left part of a dial or a switch with 3 or more positions. This image must be 32x32 32-bit PNG file.
3 CURSOR_RIGHT String Dial, Switch None Set custom cursor image when user is hovering over the right part of a dial or a switch with 3 or more positions. This image must be 32x32 32-bit PNG file.
4 CURSOR_TOP String Switch None Set custom cursor image when user is hovering over the top part of a switch. This image must be 32x32 32-bit PNG file. Available from AM/AP 4.0.
5 CURSOR_BOTTOM String Switch None Set custom cursor image when user is hovering over the bottom part of a switch. This image must be 32x32 32-bit PNG file. Available from AM/AP 4.0.
6 CLICK_ROTATE Number Dial None Number of degrees rotating of the dial image on mouse click.
7 SCROLL_TICK Number Scroll wheel Dynamic This value determines the number of pixels between two scroll wheel callbacks.

Example

function callback(direction)
  print("dial has been turned")
end
 
dial_id = dial_add("a.png", 100,100,100,100,callback)

-- We want to set our custom cursors for this dial
mouse_setting(dial_id , "CURSOR_LEFT", "cursor_left.png")
mouse_setting(dial_id , "CURSOR_RIGHT", "cursor_right.png")