{"_id":"5b1f8576c2505d00031254a0","category":{"_id":"5b1f8576c2505d0003125425","version":"5b1f8576c2505d00031254db","project":"571fa55ca0acd42000af9545","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-07-31T16:56:01.612Z","from_sync":false,"order":1,"slug":"prefabs","title":"Prefabs"},"user":"571fa519db52d01700f5cf3d","parentDoc":null,"project":"571fa55ca0acd42000af9545","version":{"_id":"5b1f8576c2505d00031254db","project":"571fa55ca0acd42000af9545","__v":4,"forked_from":"594949e52be16d0026ec04cd","createdAt":"2017-06-20T16:14:29.816Z","releaseDate":"2017-06-20T16:14:29.816Z","categories":["5b1f8576c2505d0003125424","5b1f8576c2505d0003125425","5b1f8576c2505d0003125426","5b1f8576c2505d0003125427","5b1f8576c2505d0003125428","5b1f8576c2505d0003125429","5b1f8576c2505d000312542a","5b1f8576c2505d000312542b","5b1f8576c2505d000312542c","5b1f8576c2505d000312542d","5b1f8576c2505d000312542e","5b1f8576c2505d000312542f","5b1f8576c2505d0003125430","5b1f8576c2505d0003125431","5b1f8576c2505d0003125432","5b1f8576c2505d0003125433","5b1f8576c2505d0003125434","5b1f8576c2505d0003125435","5b1f8576c2505d0003125436","5b1f8576c2505d0003125437","5b1f8576c2505d0003125438","5b1f8aab9c683000032979e7","5b1f8b2f3073470003ffa5da","5b1f8bd9fd653400031d94f4","5b1f900bd4c5f000036b57bd"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"Mangalica","version_clean":"3.3.0","version":"3.3.0"},"githubsync":"","__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-07-31T17:28:48.419Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":7,"body":"## Overview\n\nAdds a collection of Object Tooltips to the Controller providing information to what the controller buttons may do.\n\n**Prefab Usage:**\n * Place the `VRTK/Prefabs/ControllerTooltips/ControllerTooltips` prefab as a child of the relevant controller script alias GameObject in the scene hierarchy.\n * If no `Button Transform Settings` are provided in the inspector at Edit time then the button transforms will attempt to be set to the transforms of the current SDK default controller model.\n * If one of the `Button Text Settings` text options are not provided, then the tooltip for that specific button will be hidden.\n\n  > There are a number of parameters that can be set on the Prefab which are provided by the `VRTK_ControllerTooltips` script which is applied to the prefab.\n\n## Inspector Parameters\n\n * **Trigger Text:** The text to display for the trigger button action.\n * **Grip Text:** The text to display for the grip button action.\n * **Touchpad Text:** The text to display for the touchpad action.\n * **Touchpad Two Text:** The text to display for the touchpad two action.\n * **Button One Text:** The text to display for button one action.\n * **Button Two Text:** The text to display for button two action.\n * **Start Menu Text:** The text to display for the start menu action.\n * **Tip Background Color:** The colour to use for the tooltip background container.\n * **Tip Text Color:** The colour to use for the text within the tooltip.\n * **Tip Line Color:** The colour to use for the line between the tooltip and the relevant controller button.\n * **Trigger:** The transform for the position of the trigger button on the controller.\n * **Grip:** The transform for the position of the grip button on the controller.\n * **Touchpad:** The transform for the position of the touchpad button on the controller.\n * **Touchpad Two:** The transform for the position of the touchpad two button on the controller.\n * **Button One:** The transform for the position of button one on the controller.\n * **Button Two:** The transform for the position of button two on the controller.\n * **Start Menu:** The transform for the position of the start menu on the controller.\n * **Controller Events:** The controller to read the controller events from. If this is blank then it will attempt to get a controller events script from the same or parent GameObject.\n * **Headset Controller Aware:** The headset controller aware script to use to see if the headset is looking at the controller. If this is blank then it will attempt to get a controller events script from the same or parent GameObject.\n * **Hide When Not In View:** If this is checked then the tooltips will be hidden when the headset is not looking at the controller.\n\n## Class Events\n\n * `ControllerTooltipOn` - Emitted when the controller tooltip is turned on.\n * `ControllerTooltipOff` - Emitted when the controller tooltip is turned off.\n\n## Unity Events\n\nAdding the `VRTK_ControllerTooltips_UnityEvents` component to `VRTK_ControllerTooltips` object allows access to `UnityEvents` that will react identically to the Class Events.\n\n * All C# delegate events are mapped to a Unity Event with the `On` prefix. e.g. `MyEvent` -> `OnMyEvent`.\n\n## Event Payload\n\n * `VRTK_ControllerTooltips.TooltipButtons element` - The tooltip element being affected.\n\n## Class Methods\n\n### ResetTooltip/0\n\n  > `public virtual void ResetTooltip()`\n\n * Parameters\n   * _none_\n * Returns\n   * _none_\n\nThe Reset method reinitalises the tooltips on all of the controller elements.\n\n### UpdateText/2\n\n  > `public virtual void UpdateText(TooltipButtons element, string newText)`\n\n * Parameters\n   * `TooltipButtons element` - The specific controller element to change the tooltip text on.\n   * `string newText` - A string containing the text to update the tooltip to display.\n * Returns\n   * _none_\n\nThe UpdateText method allows the tooltip text on a specific controller element to be updated at runtime.\n\n### ToggleTips/2\n\n  > `public virtual void ToggleTips(bool state, TooltipButtons element = TooltipButtons.None)`\n\n * Parameters\n   * `bool state` - The state of whether to display or hide the controller tooltips, true will display and false will hide.\n   * `TooltipButtons element` - The specific element to hide the tooltip on, if it is `TooltipButtons.None` then it will hide all tooltips. Optional parameter defaults to `TooltipButtons.None`\n * Returns\n   * _none_\n\nThe ToggleTips method will display the controller tooltips if the state is `true` and will hide the controller tooltips if the state is `false`. An optional `element` can be passed to target a specific controller tooltip to toggle otherwise all tooltips are toggled.\n\n## Example\n\n`VRTK/Examples/029_Controller_Tooltips` displays two cubes that have an object tooltip added to them along with tooltips that have been added to the controllers.","excerpt":"","slug":"controllertooltips","type":"basic","title":"Controller Tooltips"}

Controller Tooltips


## Overview Adds a collection of Object Tooltips to the Controller providing information to what the controller buttons may do. **Prefab Usage:** * Place the `VRTK/Prefabs/ControllerTooltips/ControllerTooltips` prefab as a child of the relevant controller script alias GameObject in the scene hierarchy. * If no `Button Transform Settings` are provided in the inspector at Edit time then the button transforms will attempt to be set to the transforms of the current SDK default controller model. * If one of the `Button Text Settings` text options are not provided, then the tooltip for that specific button will be hidden. > There are a number of parameters that can be set on the Prefab which are provided by the `VRTK_ControllerTooltips` script which is applied to the prefab. ## Inspector Parameters * **Trigger Text:** The text to display for the trigger button action. * **Grip Text:** The text to display for the grip button action. * **Touchpad Text:** The text to display for the touchpad action. * **Touchpad Two Text:** The text to display for the touchpad two action. * **Button One Text:** The text to display for button one action. * **Button Two Text:** The text to display for button two action. * **Start Menu Text:** The text to display for the start menu action. * **Tip Background Color:** The colour to use for the tooltip background container. * **Tip Text Color:** The colour to use for the text within the tooltip. * **Tip Line Color:** The colour to use for the line between the tooltip and the relevant controller button. * **Trigger:** The transform for the position of the trigger button on the controller. * **Grip:** The transform for the position of the grip button on the controller. * **Touchpad:** The transform for the position of the touchpad button on the controller. * **Touchpad Two:** The transform for the position of the touchpad two button on the controller. * **Button One:** The transform for the position of button one on the controller. * **Button Two:** The transform for the position of button two on the controller. * **Start Menu:** The transform for the position of the start menu on the controller. * **Controller Events:** The controller to read the controller events from. If this is blank then it will attempt to get a controller events script from the same or parent GameObject. * **Headset Controller Aware:** The headset controller aware script to use to see if the headset is looking at the controller. If this is blank then it will attempt to get a controller events script from the same or parent GameObject. * **Hide When Not In View:** If this is checked then the tooltips will be hidden when the headset is not looking at the controller. ## Class Events * `ControllerTooltipOn` - Emitted when the controller tooltip is turned on. * `ControllerTooltipOff` - Emitted when the controller tooltip is turned off. ## Unity Events Adding the `VRTK_ControllerTooltips_UnityEvents` component to `VRTK_ControllerTooltips` object allows access to `UnityEvents` that will react identically to the Class Events. * All C# delegate events are mapped to a Unity Event with the `On` prefix. e.g. `MyEvent` -> `OnMyEvent`. ## Event Payload * `VRTK_ControllerTooltips.TooltipButtons element` - The tooltip element being affected. ## Class Methods ### ResetTooltip/0 > `public virtual void ResetTooltip()` * Parameters * _none_ * Returns * _none_ The Reset method reinitalises the tooltips on all of the controller elements. ### UpdateText/2 > `public virtual void UpdateText(TooltipButtons element, string newText)` * Parameters * `TooltipButtons element` - The specific controller element to change the tooltip text on. * `string newText` - A string containing the text to update the tooltip to display. * Returns * _none_ The UpdateText method allows the tooltip text on a specific controller element to be updated at runtime. ### ToggleTips/2 > `public virtual void ToggleTips(bool state, TooltipButtons element = TooltipButtons.None)` * Parameters * `bool state` - The state of whether to display or hide the controller tooltips, true will display and false will hide. * `TooltipButtons element` - The specific element to hide the tooltip on, if it is `TooltipButtons.None` then it will hide all tooltips. Optional parameter defaults to `TooltipButtons.None` * Returns * _none_ The ToggleTips method will display the controller tooltips if the state is `true` and will hide the controller tooltips if the state is `false`. An optional `element` can be passed to target a specific controller tooltip to toggle otherwise all tooltips are toggled. ## Example `VRTK/Examples/029_Controller_Tooltips` displays two cubes that have an object tooltip added to them along with tooltips that have been added to the controllers.