Hello everyone.

The Mixed Reality Forums here are no longer being used or maintained.

There are a few other places we would like to direct you to for support, both from Microsoft and from the community.

The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.

For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.

If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.

And always feel free to hit us up on Twitter @MxdRealityDev.

How Can I display Hello World Text On my Hologram app?

edited June 2016 in Questions And Answers

How Can I display Hello World Text On my Holographic app, this text "Hello World" need to displayed dynamically at runtime, for example this could be a twitter feed.

Best Answer

Answers

  • ContextVRContextVR ✭✭✭

    I would start looking into MVC/MMVM patterns and things like uGUI and Text Mesh Pro.

  • HoloSheepHoloSheep mod
    edited June 2016

    @ManojTalreja sounds like you are looking for Unity UI.

    Look at the create dropdown at the top of the Hierarchy pane.
    BUT.. there are a lot of weird issues that you will need to fuss with.

    If you add a text element, it will put it inside a canvas as a container.

    • set canvas render mode to World Space
    • zero out the position of the canvas.
    • adjust the canvas Scale values to be 0.01 for x, y, z
    • adjust the canvas to be in front of you by setting your z = 2
    • unfortunately text defaults to black and requires you to create a material for it
    • create new material, set its shader to GUI/Text Shader, give it your color of choice
    • assign that new material to the text objects material property

    Set the Text property of the text object to Hello World.

    To programmatically set the text property do something like:

    using UnityEngine.UI;
    
    Text myTextControl;
    
    GameObject temp = GameObject.Find("Text");
    myTextControl = temp.GetComponent<Text>();
    myTextControl.text = "different text";
    

    where "Text" is the name of the Text object in your Hierarchy.

    Windows Holographic User Group Redmond

    WinHUGR.org - - - - - - - - - - - - - - - - - - @WinHUGR
    WinHUGR YouTube Channel -- live streamed meetings

  • ContextVRContextVR ✭✭✭

    Default uGUI text is a good option for "Hello World" apps, but for production apps I would use a vector-based text plugin such as Text Mesh Pro, which is compatible with uGUI.

  • @HoloSheep said:
    @ManojTalreja sounds like you are looking for Unity UI.

    Look at the create dropdown at the top of the Hierarchy pane.
    BUT.. there are a lot of weird issues that you will need to fuss with.

    If you add a text element, it will put it inside a canvas as a container.

    • set canvas render mode to World Space
    • zero out the position of the canvas.

    @HoloSheep Hi there, I have exported the HoloToolikit-Unity package into a new blank Unity project, as well as a Canvas and Panel (in ScreenSpace-Camera mode and HoloLensCamera prefab as RenderCamera) but I cannot change the position of the Canvas. You say "zero out the position of the canvas" but mine is greyed out. What am I missing?

Sign In or Register to comment.