0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

UnityのSquareに画像を敷き詰めて表示したい

Last updated at Posted at 2025-11-12

手順は3つ

1.画像を用意しましょう。
2.マテリアルを作成しましょう。
3.Squareで画像とマテリアルを設定しましょう。

1.画像(テクスチャ)を用意しましょう。

(1)敷き詰めたい画像(テクスチャ)をプロジェクトに追加します。
(2)画像(テクスチャ)のInspectorで、Wrap ModeをRepeatに設定します。
スクリーンショット 2025-11-12 113554.png

2.マテリアルを作成しましょう。

(1)Assets内の作成したいフォルダで、右クリックして以下を選択します。
Create>Rendering>Material
(2)作成したマテリアルのShaderをUnit/Textureに設定します。
スクリーンショット 2025-11-12 115125.png

3.Squareで画像とマテリアルを設定しましょう。

(1)SquareのInspectorのSprite Renderで、Spriteに1.の敷き詰める画像、Materialに2.のマテリアルを設定します。
スクリーンショット 2025-11-12 115858.png
(2)Inspectorのマテリアルで、TilingのXとYに繰り返し回数を設定します。
スクリーンショット 2025-11-12 120058.png

以上で、Squareに画像が敷き詰められて表示されると思います。
もし、Box Collider 2Dの大きさが合わなくなったりする場合は、
InspectorのBox Collider 2Dの設定でResetを選択してみてください。

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?