{"_id":"58796782cd4a9c37007c9752","__v":0,"version":{"_id":"58796781cd4a9c37007c96ef","__v":4,"project":"571fa55ca0acd42000af9545","createdAt":"2017-01-13T23:49:21.393Z","releaseDate":"2017-01-13T23:49:21.393Z","categories":["58796781cd4a9c37007c96f0","58796781cd4a9c37007c96f1","58796781cd4a9c37007c96f2","58796781cd4a9c37007c96f3","58796781cd4a9c37007c96f4","58796781cd4a9c37007c96f5","58796781cd4a9c37007c96f6","58796781cd4a9c37007c96f7","58796781cd4a9c37007c96f8","58796781cd4a9c37007c96f9","58796781cd4a9c37007c96fa","58796781cd4a9c37007c96fb","58796781cd4a9c37007c96fc","58796781cd4a9c37007c96fd","58796781cd4a9c37007c96fe","58796781cd4a9c37007c96ff","58796781cd4a9c37007c9700","58b157ca1756cf370022f90d","58b1596f5dae732f00adeca2","58b1605a5dae732f00adecb1"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"Mukota","version_clean":"3.1.0","version":"3.1.0"},"user":"571fa519db52d01700f5cf3d","category":{"_id":"58796781cd4a9c37007c96f1","project":"571fa55ca0acd42000af9545","__v":0,"version":"58796781cd4a9c37007c96ef","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-07-31T16:56:01.612Z","from_sync":false,"order":1,"slug":"prefabs","title":"Prefabs"},"parentDoc":null,"project":"571fa55ca0acd42000af9545","updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-07-31T17:28:48.419Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":4,"body":"## Overview\n\nThis adds a collection of Object Tooltips to the Controller that give information on what the main controller buttons may do. To add the prefab, it just needs to be added as a child of the relevant alias controller GameObject.\n\nIf the transforms for the buttons are not provided, then the script will attempt to find the attach transforms on the default controller model.\n\nIf no text is provided for one of the elements then the tooltip for that element will be set to disabled.\n\nThere 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 * **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 * **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\n## Class Methods\n\n### ResetTooltip/0\n\n  > `public 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 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 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 This adds a collection of Object Tooltips to the Controller that give information on what the main controller buttons may do. To add the prefab, it just needs to be added as a child of the relevant alias controller GameObject. If the transforms for the buttons are not provided, then the script will attempt to find the attach transforms on the default controller model. If no text is provided for one of the elements then the tooltip for that element will be set to disabled. 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. * **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. * **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. ## Class Methods ### ResetTooltip/0 > `public void ResetTooltip()` * Parameters * _none_ * Returns * _none_ The Reset method reinitalises the tooltips on all of the controller elements. ### UpdateText/2 > `public 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 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.