Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Hololens UI interface design and audio playback

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article introduces the relevant knowledge of "Hololens UI interface design and audio playback". In the actual case operation process, many people will encounter such difficulties. Next, let Xiaobian lead you to learn how to deal with these situations! I hope you can read carefully and learn something!

Create a new scene called UI_Audio. Drag some prerequisites from HoloTookit to the dashboard, which is required before most development, as shown.

2, you can go to AssertStore to download a more professional UI interface, below we use Unity's own UI tools to simply implement a display image interface. Create UI->Canvas in the panel, UI->Image on Canvas, UI->RawImage and UI->Button on Image. as shown in the figure.

4. Next, change the Render Mode of Canva to World Space, and drag the HololensCamera component in the panel to EventCamera. To facilitate UI management, set X and Y in Scale to 0.0625. To make the fonts more realistic (to avoid font artifacts), we set the Dynamic Pixels Per Unit under CanvaScaler to 10. To make the UI initial position appear a certain distance in front of our line of sight, we set PosX to 0, PosY to 0, and PosZ to 3 for Canvas. as shown in the figure.

Set Width and Height of RawImage to 150 and X and Y of Scale to 0.5. We display the image on RawImage, which is achieved by assigning a value to Texture. Let's create a new C#text: ShowImageAction with the following code.

7. Finally, the event response to Button. Set Button Width to 160, Height to 30, PosY to-40, X and Y to 0.5 in Scale. Drag RawImage in Button On Click() and select the ShowImage () method. This way, when you click Button, the image will be displayed, as shown in the figure.

Select Spatialize on AudioSource, uncheck Play On Wake, select VolumeRolloff as CustomRolloff, and drag the audio file onto AudioClip.

Add it to RawImage and add an On Click () event to Button.

How to build projects and deploy them to Hololens is something I've talked about before, so I won't say much about it here. I'm going to share the final results directly with you.

"Hololens UI interface design and audio playback" content is introduced here, thank you for reading. If you want to know more about industry-related knowledge, you can pay attention to the website. Xiaobian will output more high-quality practical articles for everyone!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report