Page tree
Skip to end of metadata
Go to start of metadata

Description

The Switch control allows you to create different types of switches. It can be configured as an on/off switch with two states or as a multi-state switch with an arbitrary number of states. Furthermore, it can be set to Increment or Decrement, to edit values stepwise. To realize exclusive switches that can act as a radio group, Exclusive mode can be selected. In this mode, each switch can be configured to send a dedicated value and all related switches are connected to the same parameter. The Switch control requires several bitmaps, depending on the specified mode and it can be set to scalable, which allows for resizing of the switch. The used bitmaps are resized according to the scale modes that are defined for the respective bitmap resources.



On this page:

Properties

PropertyDescription
NameThe name of the Switch.
Position/Size
Position and Size of the element in pixels.

Pos x, Pos y, Width, Height (Pos = Position of upper left corner)

Attach
  • Left: If the parent is resized, the control remains attached to left edge, with the specified ratio.
  • Right: If the parent is resized, the control moves relatively to the right edge, with the specified ratio.
  • Top: If the parent is resized, the control remains attached to top edge, with the specified ratio.
  • Bottom: If the parent is resized, the control moves relatively to the bottom edge, with the specified ratio.
  • Left + Right: If the parent is resized, the control is resized horizontally relatively to the left and right edges, with the specified ratio.
  • Top + Bottom: If the parent is resized, the control is resized vertically relatively to the top and bottom edges, with the specified ratio.
Tip
Text that appears as a tooltip when the mouse hovers over the element.
Value
Drag and drop a HALion parameter onto this text field to establish a connection. The assigned parameter will be displayed.

Alternatively, you can export the property, which can then be used as a template parameter on a template instance.

Mode
  • Push: Sends a value of 1 and returns to 0. This mode requires bitmaps for "Bmp Off" and "Bmp On". If Hover is active, an additional bitmap "Bmp Off Hv" is required.
  • OnOff: Sets a value of 1 when pressed,0 when pressed again. This mode requires bitmaps "Bmp Off", "Bmp Off Dn", "Bmp On", "Bmp On Dn". If Hover is active, the additional bitmaps "Bmp Off Hv" and Bmp On Hov" are required.
  • On: In this mode, the switch can only be turned on. This mode is used in combination with other switches in radio groups. In this case, only one switch within the radio group can turn off another switch.
  • Multiple: In this mode, the switch can step through multiple states each time that it is clicked. For each state, the bitmaps must refer to bitmap resources or sections that contain a vertically aligned subframe per state, comparable to an animation sequence, such as the one that is used in knob controls, for example.
  • Increment: This mode allows you to increment the connected parameter value each time that the switch is clicked.
  • Decrement: This mode allows you to decrement the connected parameter value each time that the switch is clicked.
  • Exclusive: This mode allows you to use multiple switches as a radio group where only one switch is active at a time. An addtional property allows you to define the value that is sent when the switch is on. To configure a radio group, connect all participating switches to the same parameter and define the Onvalues for each switch.
  • Hover: This mode allows you to switch directly from 0 to max (depending on the connected parameter) when hovering the switch without needing to click it.
  • Hover Exclusive: This mode allows you to use multiple hover switches as a radio group where only one switch is active at a time. An additional property allows you to define the value that is sent when the switch is on. To configure a radio group, connect all participating switches to the same parameter and define the Onvalues for each switch. (Only available in HALion 6.3)
Style
  • Hover: Shows a dedicated bitmap when hovering the switch. A hover bitmap resource must be assigned.
  • Shaped: The switch only reacts when you click the visible pixels, that is, the pixels with an alpha value > 0.
  • Invert: Inverts the displayed bitmaps.
  • Scalable: Activate this option if you want to be able to resize the switch. In that case, the assigned bitmap resources are resized according to their set scale mode. This also works if the switch is set to "multiple". In this case, the margin splitters are defined as for simple bitmaps, but the lower splitter must be set in the lowest subframe.
  • Popup: This mode allows you to use a switch to open a template as a popup. (Only available in HALion 6.3)
TemplateHere, you can specify the template that is shown when the switch is clicked. (Only available with the Popup style and in HALion 6.3)
Close on Click
  • Inside: Activate this option if you want the Popup to close when a click inside the template is performed. This can be used to create menu popups where the popup closes when a menu entry is selected, for example.
  • Outside: Activate this option if you want the Popup to close when a click outside the template is performed (but within the area of the macro page). This can be used to close menu popups without the need to select one of the items, for example. If this option is deactivated, it can be used to create popups that remain visible until they are closed, for example, using a close switch on the popup.

(Only available with the Popup style and in HALion 6.3)

Placement

Here, you can specify where on the macro page the popup is shown. The options define the postion of the popup in relation to the switch.

  • Place Left: The popup opens on the left side of the switch.
  • Place Right: The popup opens on the right side of the switch.
  • Place Left+Right: The popup opens horizontally centered.
  • Place Above: The popup opens above the switch.
  • Place Below: The popup opens below the switch.
  • Place Above+Below: The popup opens vertically centered.

(Only available with the Popup style and in HALion 6.3)

Bmp OffAllows you to assign the bitmap that is used for the off state.
Bmp Off DnAllows you to assign the bitmap that is used for the off state with mouse button held down.
Bmp Off HvAllows you to assign the bitmap that is used for the off state when the mouse is hovering over the switch.
Bmp OnAllows you to assign the bitmap that is used for the on state.
Bmp On Dn

Allows you to assign the bitmap that is used for the on state with the mouse button pressed.

Bmp On HvAllows you to assign the bitmap that is used for the on state when the mouse is hovering over the switch.
Onvalue

Allows you to define the value that is sent when the switch is turned on. This option is only available in Exclusive mode. If you want to create a switch template that allows you to specify the Onvalue on a template instance level, you must export this property. Click the Export button on the right of the Onvalue field. Now, a switch template shows the additional Onvalue as a template parameter and you can use the switch template several times and configure each template instance individually.

State
Allows you to assign a multi-frame bitmap that is used for the different states. (Only available in Mutiple mode and in HALion 6.1)
State Down
Allows you to assign a multi-frame bitmap that is used for the different states with the mouse button pressed. (Only available in Mutiple mode and in HALion 6.1)
State HoverAllows you to assign a multi-frame bitmap that is used for the different states when the mouse is hovering over the switch. (Only available in Mutiple mode and in HALion 6.1)

Examples

Radio buttons

A radio switch group can be realized by connecting several switches, all set to Exclusive mode, to the same parameter. For each switch, the Onvalue must be specified.

Switching pages

  1. Create an integer variable, name it "Pages", for example, and specify a range of 0-2.
  2. Add three (exlusive) switches and set their Values to the variable "Pages".
  3. Set the Onvalues of the switches to 0,1, and 2.
  4. Add a Stack with 3 child views and set the stack Value to the variable "Pages", too.
  5. The switches now allow to switch between the three views.

Hover mode Switch

The hover mode can be used to switch between stack views when hovering over a switch control. Since the switch can also be used invisible, that is, without any bitmap assigned, it can be layered under a knob control and control a stack view switching between the parameter label and a text view displaying the current parameter value. To see how this can be set up, load one of the knobs from the Additional Controls library.

  • No labels

3 Comments

  1. Added descriptions for State, State Down and State Hover.