Views 2666 Votes 0 Comment 1
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print

GUI를 화면에 그리는 스크립트입니다.

a는 그려질 화면의 위치 중 x좌표.

b는 그려질 화면의 위치 중 y좌표.

c는 그려질 텍스쳐의 크기 중 가로크기.

d는 그려질 텍스쳐의 크기 중 세로크기.

입니다.

스크립트를 유니티에 끌어다 놓고 보시면 None(Texture2D)라는 글이 써져있는 네모난 칸이 있는데,

그 안에 화면에 표시할 이미지를 드래그 앤 드롭하시면 됩니다.

 

[스크립트]

 

using UnityEngine;
using System.Collections;

public class menus : MonoBehaviour {
    public Texture2D button = null;
    public int a = 0;
    public int b = 0;
    public int c = 0;
    public int d = 0;

    void OnGUI() {
        GUI.DrawTexture (new Rect (a, b, c, d), button);
    }
}


 

 

?
  • profile
    천무 2016.02.04 13:25
    유니티도 보면 참 제작환경이 좋은것 같습니다.

List of Articles
No. Category Subject Author Date Views Votes
» Unity Script 화면에 이미지를 표시하는 스크립트(C#) 1 zerosium 2016.02.04 2666 0
3 Unity Script 유니티)캐릭터 좌우 이동 (C#) 4 zerosium 2016.01.05 1235 0
2 Unity Script [C#] 보안 64비트 정수 맛난호빵 2016.01.04 639 0
1 Unity Script 구간 루프 음악 스크립트 맛난호빵 2015.08.24 430 0
Board Pagination Prev 1 Next
/ 1


[privacy statements] | [Terms of Use] | [Contact us] | [Sponsorship] | [Indiside History]

Copyright © 1999 - 2016 INdiSide.com/CL3D Co., Ltd. All Rights Reserved.
Owner : Chunmu(Jiseon Lee) | kernys(Wonbae Kim) | Sasinji(Byungkook Kim)