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.
Options

How to draw a texture

Hi, I need to display a image in my App. I used the following command, but I did not see anything in hololens screen. Maybe my Rect parameter was not correct? Then what should it be? What is the best way to display a image in hololens view?

Thanks,

void OnGUI()
{
if(newTexture)
{
newTexture = false;
GUI.DrawTexture(new Rect(10, 10, 60, 60), targetTexture);
}
}

Answers

  • Options

    Do not use OnGUI or the old unity GUI, its horrendous. Use the new UnityGUI .. canvas/panel/image/text etc.

    Healthcare IT professional by day - Indie GameDev for UWP and mobile platforms by night

  • Options

    @Fireman here is a link with some basic info about some of the tweaks you will want to be aware of to get Unity UI to play nice on the HoloLens in case it helps.

    You might want to look at setting the Source Image of an Image.

    HTH

    Windows Holographic User Group Redmond

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

Sign In or Register to comment.