This site has been permanently archived. The content on this site was last updated in 2019.
Stay organized with collections
Save and categorize content based on your preferences.
GvrKeyboardCanvas prefab
Customizable text canvas that provides keyboard input in VR using the Daydream controller.
Requires an instance of the GvrKeyboardManager
prefab in the scene.
Position this game object in the scene so that the text canvas is visible to the player during text entry. To bring up the keyboard when the player clicks on the text canvas, connect the EventTrigger's "Pointer Click" event to the GvrKeyboardManager's GvrKeyboard.OnPointerClick
method, following the example in the included KeyboardDemo scene:
![]()
Prefab Hierarchy
Game object name |
Description |
|
Positions worldscale canvas that holds the text component. |
|
Renders the customizable background behind the text component. |
|
Renders the customizable text component. |
GvrKeyboardCanvas game object
Positions worldscale canvas that holds the text component.
Components:
GvrPointerGraphicRaycaster,
UnityEngine.BoxCollider,
UnityEngine.Canvas,
UnityEngine.EventSystems.EventTrigger,
UnityEngine.RectTransform,
UnityEngine.UI.CanvasScaler
Background game object
Renders the customizable background behind the text component.
Components:
UnityEngine.CanvasRenderer,
UnityEngine.RectTransform,
UnityEngine.UI.Image
KeyboardText game object
Renders the customizable text component.
Components:
UnityEngine.CanvasRenderer,
UnityEngine.RectTransform,
UnityEngine.UI.Text
All rights reserved. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-09 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-09 UTC."],[[["\u003cp\u003eThe GvrKeyboardCanvas prefab provides customizable text input in VR using the Daydream controller.\u003c/p\u003e\n"],["\u003cp\u003eIt requires a GvrKeyboardManager prefab in the scene and needs to be positioned for player visibility.\u003c/p\u003e\n"],["\u003cp\u003eTo activate the keyboard, link the EventTrigger's "Pointer Click" event to the GvrKeyboardManager's \u003ccode\u003eGvrKeyboard.OnPointerClick\u003c/code\u003e method.\u003c/p\u003e\n"],["\u003cp\u003eThe prefab includes a customizable background and text component for user interface design.\u003c/p\u003e\n"]]],["The `GvrKeyboardCanvas` prefab allows VR text input via the Daydream controller. It requires the `GvrKeyboardManager` prefab. Users should position the canvas for visibility and connect the EventTrigger's \"Pointer Click\" to `GvrKeyboard.OnPointerClick` to activate the keyboard. The prefab contains `GvrKeyboardCanvas` (text holder), `Background` (customizable background), and `KeyboardText` (customizable text). Each element has its specific set of components.\n"],null,["# GvrKeyboardCanvas prefab\n========================\n\nCustomizable text canvas that provides keyboard input in VR using the Daydream controller.\n\nRequires an instance of the [`GvrKeyboardManager`](/vr/reference/unity/prefab/GvrKeyboardManager) prefab in the scene.\n\nPosition this game object in the scene so that the text canvas is visible to the player during text entry. To bring up the keyboard when the player clicks on the text canvas, connect the EventTrigger's \"Pointer Click\" event to the GvrKeyboardManager's `GvrKeyboard.OnPointerClick` method, following the example in the included **KeyboardDemo** scene:\n\nPrefab Hierarchy\n----------------\n\n| Game object name | Description |\n|--------------------------------------------------|----------------------------------------------------------------|\n| [`GvrKeyboardCanvas`](#GvrKeyboardCanvas_object) | Positions worldscale canvas that holds the text component. |\n| └ [`Background`](#Background_object) | Renders the customizable background behind the text component. |\n| └ [`KeyboardText`](#KeyboardText_object) | Renders the customizable text component. |\n\nGvrKeyboardCanvas game object\n-----------------------------\n\nPositions worldscale canvas that holds the text component.\n\nComponents:\n\n[GvrPointerGraphicRaycaster](/vr/reference/unity/class/GvrPointerGraphicRaycaster),\n\n\n[UnityEngine.BoxCollider](https://docs.unity3d.com/Manual/class-BoxCollider.html),\n\n[UnityEngine.Canvas](https://docs.unity3d.com/Manual/class-Canvas.html),\n\n[UnityEngine.EventSystems.EventTrigger](https://docs.unity3d.com/Manual/script-EventTrigger.html),\n\n[UnityEngine.RectTransform](https://docs.unity3d.com/Manual/class-RectTransform.html),\n\n[UnityEngine.UI.CanvasScaler](https://docs.unity3d.com/Manual/script-CanvasScaler.html)\n\nBackground game object\n----------------------\n\nRenders the customizable background behind the text component.\n\nComponents:\n\n\n[UnityEngine.CanvasRenderer](https://docs.unity3d.com/Manual/class-CanvasRenderer.html),\n\n[UnityEngine.RectTransform](https://docs.unity3d.com/Manual/class-RectTransform.html),\n\n[UnityEngine.UI.Image](https://docs.unity3d.com/Manual/script-Image.html)\n\nKeyboardText game object\n------------------------\n\nRenders the customizable text component.\n\nComponents:\n\n\n[UnityEngine.CanvasRenderer](https://docs.unity3d.com/Manual/class-CanvasRenderer.html),\n\n[UnityEngine.RectTransform](https://docs.unity3d.com/Manual/class-RectTransform.html),\n\n[UnityEngine.UI.Text](https://docs.unity3d.com/Manual/script-Text.html)"]]