1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

【Unity初心者】超簡単! UIを手前に表示させる方法

Last updated at Posted at 2020-04-11

環境

Unity 2019.3.7f1

方法

ヒエラルキー上で表示順を変更するだけ。
下にいくほど手前に表示される。

座標からは調整できない

テキストなどのUIには、下図のようなRectTransformコンポーネントがあり、

image.png

この値を調整することで座標を変えることができます。
カメラに近い方が手前に表示されそう~と思いますよね!?
しかし!
UIの座標表示順はそれぞれ独立しており、
座標をいくら変更しても表示順は変わりません!!

最初、このことがわからなくてず~っと悩みました!

具体例

以下2つを作成して適当に重ねる
・Text
・Image
image.png
TextがImageの後ろに隠れています。
ヒエラルキー上でTextをImageより下に移動させてテキストを全部見えるようにしましょう。
image.png
Textが見えるようになりました!

この表示順についての知識はゲームオブジェクトが同じ座標にあるときにも使えるので覚えておきましょう~。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?