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
    유니티도 보면 참 제작환경이 좋은것 같습니다.

  1. 화면에 이미지를 표시하는 스크립트(C#)

    Date2016.02.04 CategoryUnity Script Byzerosium Views2666 Votes0
    Read More
  2. 유니티)캐릭터 좌우 이동 (C#)

    Date2016.01.05 CategoryUnity Script Byzerosium Views1237 Votes0
    Read More
  3. [C#] 보안 64비트 정수

    Date2016.01.04 CategoryUnity Script By맛난호빵 Views640 Votes0
    Read More
  4. 구간 루프 음악 스크립트

    Date2015.08.24 CategoryUnity Script By맛난호빵 Views430 Votes0
    Read More
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)