Scripting / Reference
UI
Types in the ParelVR.Volt.UI namespace.
VoltButton#
ParelVR.Volt.UI.VoltButton reference extends VoltComponent
A button. Wire its click to a behaviour's public method in the inspector.
VoltButton properties#
Whether players can press the button.
VoltCanvas#
ParelVR.Volt.UI.VoltCanvas reference extends VoltComponent
A canvas in the world.
VoltCanvas properties#
Whether the canvas is drawn.
VoltDialogs#
ParelVR.Volt.UI.VoltDialogs static
Messages and questions for the local player, shown by ParelVR's own interface so they work on desktop and in VR.
VoltDialogs properties#
True when the client can show notifications and dialogs.
VoltDialogs methods#
Asks the local player a yes/no question. Returns an id, or 0 when a dialog of this world is already open; the answer arrives as OnDialogResult(id, confirmed) on the calling script.
Shows a short message to the local player. At most one a second; extra ones are dropped.
VoltImage#
ParelVR.Volt.UI.VoltImage reference extends VoltComponent
A picture element.
VoltImage properties#
Tint of the picture.
Whether the picture is drawn.
How much of a filled image is drawn, 0 to 1.
The texture a raw image shows, for example a render texture a camera draws into. A sprite image keeps its sprite.
VoltInputField#
ParelVR.Volt.UI.VoltInputField reference extends VoltComponent
A text box players can type into.
VoltInputField properties#
Whether players can type into the box.
The text in the box.
VoltPanel#
ParelVR.Volt.UI.VoltPanel reference extends VoltComponent
A rectangle of the UI: the layout of anything on a canvas.
VoltPanel properties#
Position of the pivot relative to the anchors.
Width and height of the rectangle.
Size relative to the distance between the anchors.
VoltPanel methods#
Shows or hides the rectangle and everything in it.
VoltScrollView#
ParelVR.Volt.UI.VoltScrollView reference extends VoltComponent
A scrolling area.
VoltScrollView properties#
The rectangle that holds the scrolled content.
Scroll position: (0, 0) is the bottom left, (1, 1) the top right.
VoltSlider#
ParelVR.Volt.UI.VoltSlider reference extends VoltComponent
A slider.
VoltSlider properties#
Whether players can move the slider.
Highest value.
Lowest value.
Current value.
VoltSlider methods#
Sets the value without raising the slider's change event.
VoltText#
ParelVR.Volt.UI.VoltText reference extends VoltComponent
A text element, legacy or TextMeshPro.
VoltText properties#
Colour of the text.
Size of the text.
The text shown. Limited to 16,000 characters.
VoltToggle#
ParelVR.Volt.UI.VoltToggle reference extends VoltComponent
A checkbox.
VoltToggle properties#
Whether players can change the box.
Whether the box is ticked.
VoltToggle methods#
Sets the state without raising the toggle's change event.
VoltUI#
ParelVR.Volt.UI.VoltUI static
Helpers for world UI.
VoltUI methods#
Turns a colour into text such as "#FF8800FF", for rich text.
Redoes the layout of a rectangle and its children now instead of at the end of the frame.
VoltWorldMenu#
ParelVR.Volt.UI.VoltWorldMenu static
The world's own menu in ParelVR's main menu (a ParelVR World Menu component in the scene): its icon in the menu's top bar opens its pages, buttons, toggles, sliders and option switchers. Controls and pages are named by the id set on them. Values are the local player's own; a script that wants everyone to see a change sends it as a network event or keeps it in a synced field. A player using a control raises OnWorldMenuButton, OnWorldMenuToggle, OnWorldMenuSlider or OnWorldMenuOption on every script; changes made here raise nothing.
VoltWorldMenu properties#
True when the world has a menu.
VoltWorldMenu methods#
The picked choice of an option switcher, from 0.
A slider's value.
Whether a toggle is on.
Opens ParelVR's menu on a page of the world's menu (empty: the page it was on).
Changes the short line under a control's name.
Lets the player use a control, or greys it out.
Changes a control's name in the menu.
Picks a choice of an option switcher, from 0.
Moves a slider (kept between its minimum and maximum).
Switches a toggle on or off (and what it switches without code).
Shows or hides a control.
