Group add

From Sim Innovations Wiki
Jump to navigation Jump to search


group_id = group_add(node_id, node_id, ...)

group_add is to group together Nodes. This function will provide with a group_id.

Return value

Argument Type Description
group_id ID This value can be used for further reference. Functions such as visible can use this group_id. Its good practice to store this map_id in your logic code.


# Argument Type Description
1 .. n node_id ID A reference to the node. This can be a button_id, switch_id, dial_id, etc. etc.


function click(var)

-- Make some GUI objects, In this case a switch, button and a dial
button_id = button_add("off.png",nil,50,50,145,145,click)
switch_id = switch_add("off.png","on.png","off.png","on.png",50,200,145,145,click)
dial_id = dial_add("on.png",200,200,145,145,click)

-- Group them together
group_id = group_add(button_id, switch_id,  dial_id)

-- Make the entire group not visible