简体   繁体   中英

How can I make that the ui text will be in front of anything else?

I want that the text to be always on the top left corner and always above in front of anything else, objects ui everything.

I want to use this ui text for saving message.

Screenshot of the Canvas settings and where the text is show in the scene window and the game window :

画布设置

And the text settings using Text - TextMeshPro :

文字设置

如果默认设置不适合您,您可以在渲染队列中向上移动文本材质。

A couple things:

  1. Camera-space UI draws on top of everything except other camera-space UI objects and screen-space UI
  2. Screen-space UI draws on top of everything except other screen-space UI objects
  3. Your objects is attached to a World-space canvas

While in theory you could fiddle with drawing order with shaders, this does not apply to UI objects (as the world is rendered first, then camera-space UI, then other cameras and their UIs, then screen-space UI).

As such you will not be able to make that text draw "in front" of anything else. It exists in 3D space and is subject to all of the rules that that entails, such as being behind screen-space canvases.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM