Hello everyone.

We have decided to phase out the Mixed Reality Forums over the next few months in favor of other ways to connect with us.

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.

The plan between now and the beginning of May is to clean up old, unanswered questions that are no longer relevant. The forums will remain open and usable.

On May 1st we will be locking the forums to new posts and replies. They will remain available for another three months for the purposes of searching them, and then they will be closed altogether on August 1st.

So, where does that leave our awesome community to ask questions? Well, there are a few places we want to engage with you. 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. 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.