4. Displaying Text - sorianog/RollABallMR GitHub Wiki

Another original feature of the “Roll-a-ball” project that was ported, was displaying the user’s score and display victory text for picking up the rotating cubes. Again a few more slight modifications were made to the existing text objects in the project. The canvas and text colors were modified from recommendations made in thread on the “Windows Mixed Reality Developer Forum”. The canvas holding the game text required its render mode to be set to “World Space”. To ensure that the text would be displayed in front of the user, the “z” position of the canvas had to be set to 2. Finally, a new material had to be created with its shader set to “GUI/Text Shader” and a chosen text color (in this case white). This material was then applied on the game text. In “Roll A Ball - Holographic” these text changes were applied to result in score and victory text being displayed and over layed on the game field.

Figure 3. Game text in the scene for the Unity project.

Figure 4. Game text objects assigned to the PlayerController script variables.

Figure 5. Accessing game text in the PlayerController script.

Figure 6. Demo of victory text being displayed.