블로그 이미지
Every unexpected event is a path to learning for you.

카테고리

분류 전체보기 (2731)
Unity3D (814)
Programming (474)
Server (33)
Unreal (4)
Gamebryo (56)
Tip & Tech (228)
협업 (57)
3DS Max (3)
Game (12)
Utility (136)
Etc (96)
Link (32)
Portfolio (19)
Subject (90)
iOS,OSX (51)
Android (14)
Linux (5)
잉여 프로젝트 (2)
게임이야기 (3)
Memories (20)
Interest (38)
Thinking (38)
한글 (30)
PaperCraft (5)
Animation (408)
Wallpaper (2)
재테크 (18)
Exercise (3)
나만의 맛집 (3)
냥이 (10)
육아 (16)
Total
Today
Yesterday
03-30 00:00

Unity3D WebView

Unity3D/Plugins / 2015. 1. 21. 17:46

Unity 3D에서 WebView를 쓸 때 유용한 소스 입니다. 

일본 개발자분이 오픈소스로 라이센스로 공개한 것 같더군요...


[소스]

https://github.com/gree/unity-webview


- Java로 작성된 Android 용 Native Plugin

- Objective-C로 작성된 iOS 용 Native Plugin

- Objective-C로 작성된 OS X 용 Native Plugin

- Native Plugin을 사용하기위한 C # Plugin


[예제 프로젝트]

https://github.com/keijiro/unity-webview-integration


unity-webview-integration 소스는 웹 페이지를 WebView로 호출에서 아래와 같이 unity와 기능을 연동한 예제 입니다.

javascript 예제여서 좀 아쉽네요. C#으로 수정해봐야 겠습니다.


http://keijiro.github.com/unity-webview-integration/index.html#

...

<title>Unity - WebView Integration Test Page</title>

<p><ul>

<li><a href="#" onclick='unity.callback("/spawn")'>Spawn a box</a></li>

<li><a href="#" onclick='unity.callback("/spawn", {color:"red"})'>Spawn a red box</a></li>

<li><a href="#" onclick='unity.callback("/spawn", {color:"blue"})'>Spawn a blue box</a></li>

<li><a href="#" onclick='unity.callback("/spawn", {color:"red", scale:0.5})'>Spawn a small red box</a></li>

<li><a href="#" onclick='unity.callback("/spawn", {color:"blue", scale:0.5})'>Spawn a small blue box</a></li>

<li><a href="#" onclick='unity.callback("/note", {text:"こんにちは"})'>「こんにちは」</a></li>

<li><a href="#" onclick='unity.callback("/note", {text:"ごきげんいかが"})'>「ごきげんいかが」</a></li>

<li><a href="#" onclick='unity.callback("/note", {text:"!@#$%^&*()-+"})'>"!@#$%^&*()-+"</a></li>

<li><a href="#" onclick='unity.callback("/close")'>Close</a></li>

<li><a href="page2.html">Go to page 2.</a></li>

</ul></p>

...


TestInterface.js (unity 3d script)

...

// Process messages coming from the web view.

private function ProcessMessages() {

    while (true) {

        // Poll a message or break.

        var message = WebMediator.PollMessage();

        if (!message) break;


        if (message.path == "/spawn") {

            // "spawn" message.

            if (message.args.ContainsKey("color")) {

                var prefab = (message.args["color"] == "red") ? redBoxPrefab : blueBoxPrefab;

            } else {

                prefab = Random.value < 0.5 ? redBoxPrefab : blueBoxPrefab;

            }

            var box = Instantiate(prefab, redBoxPrefab.transform.position, Random.rotation) as GameObject; 

            if (message.args.ContainsKey("scale")) {

                box.transform.localScale = Vector3.one * float.Parse(message.args["scale"] as String);

            }

        } else if (message.path == "/note") {

            // "note" message.

            note = message.args["text"] as String;

        } else if (message.path == "/print") {

            // "print" message.

            var text = message.args["line1"] as String;

            if (message.args.ContainsKey("line2")) {

                text += "\n" + message.args["line2"] as String;

            }

            Debug.Log(text);

            Debug.Log("(" + text.Length + " chars)");

        } else if (message.path == "/close") {

            // "close" message.

            DeactivateWebView();

        }

    }

}

...



// C#으로 변환한 소스 입니다.  by asuss님(출처 : http://reysion.tistory.com/34 의 댓글)

using UnityEngine;
using System.Collections;

public class TestWebView : MonoBehaviour {

public GUISkin guiSkin;
public GameObject redBoxPrefab;
public GameObject blueBoxPrefab;

private string note;

// Show the web view (with margins) and load the index page.
void ActivateWebView() {
WebMediator.LoadUrl("http://keijiro.github.com/unity-webview-integration/index.html");
WebMediator.SetMargin(12, Screen.height / 2 + 12, 12, 12);
WebMediator.Show();
}

// Hide the web view.
void DeactivateWebView() {
WebMediator.Hide();
// Clear the state of the web view (by loading a blank page).
WebMediator.LoadUrl("about:blank");
}

// Process messages coming from the web view.
void ProcessMessages() {
while (true) {
// Poll a message or break.
WebMediatorMessage message = WebMediator.PollMessage();
if (message == null) 
break;

if (message.path == "/spawn") {
// "spawn" message.
GameObject prefab = null;
if (message.args.ContainsKey("color")) {
prefab = (message.args["color"] == "red") ? redBoxPrefab : blueBoxPrefab;
} else {
prefab = Random.value < 0.5 ? redBoxPrefab : blueBoxPrefab;
}
var box = Instantiate(prefab, redBoxPrefab.transform.position, Random.rotation) as GameObject; 
if (message.args.ContainsKey("scale")) {
box.transform.localScale = Vector3.one * float.Parse(message.args["scale"] as string);
}
} else if (message.path == "/note") {
// "note" message.
note = message.args["text"] as string;
} else if (message.path == "/print") {
// "print" message.
var text = message.args["line1"] as string;
if (message.args.ContainsKey("line2")) {
text += "\n" + message.args["line2"] as string;
}
Debug.Log(text);
Debug.Log("(" + text.Length + " chars)");
} else if (message.path == "/close") {
// "close" message.
DeactivateWebView();
}
}
}

void Start() {
WebMediator.Install();
}

void Update() {
if (WebMediator.IsVisible()) {
ProcessMessages();
} else if (Input.GetButtonDown("Fire1") && Input.mousePosition.y < Screen.height / 2) {
ActivateWebView();
}
}

void OnGUI() {
float sw = Screen.width;
float sh = Screen.height;
GUI.skin = guiSkin;
if(note != null) 
GUI.Label(new Rect(0, 0, sw, sh/2), note);
GUI.Label(new Rect(0, sh/2, sw, sh/2), "TAP HERE", "center");
}
}



출처 : http://reysion.tistory.com/34

반응형
Posted by blueasa
, |

Unity Cloud Data 소개

Unity3D/Link / 2015. 1. 20. 19:34

링크 : http://www.gamedevforever.com/321



시간 나면 한 번 써보고 싶은 시스템인 듯..


포톤 클라우드 생각나게 하네요.


포톤보다 더 심플해서 편 한 것 같기도 하고..

반응형

'Unity3D > Link' 카테고리의 다른 글

[Link] Unity 3 Audio Spectrum Analysis  (0) 2016.06.21
[링크] Unity3D 일일 자동 빌드 하기  (0) 2016.06.14
unity3d grid  (0) 2014.12.19
Tree Pack(FBX)  (0) 2014.09.03
awesome-unity - UNITY 관련 자료 모음 GitHub 프로젝트  (0) 2014.08.14
Posted by blueasa
, |


참조1 : http://www.devkorea.co.kr/bbs/board.php?bo_table=m03_qna&wr_id=29578


참조2 : http://wiki.unity3d.com/index.php/HtmlTexturePlugin


참조3 : http://labs.awesomium.com/unity3d-integration-tutorial-part-1/

반응형

'Unity3D > Plugins' 카테고리의 다른 글

UniWebView - Integrating WebView to your mobile games in a simple way  (0) 2015.01.21
Unity3D WebView  (0) 2015.01.21
Loading DDS, BMP, TGA and other textures via WWW class in Unity3d  (0) 2014.04.11
Log Viewer  (0) 2014.01.09
Mobile Movie Texture  (0) 2013.12.03
Posted by blueasa
, |
각 플랫폼별로 Application 클래스의 프로퍼티들이 지정하는 경로와 엑세스에 대해 정리해보았습니다.
테스트한 기기에 따라 결과가 다를 수 있는데, 미진한 부분들은 댓글 남겨주시면 감사하겠습니다.

[윈도우 에디터]
Application.persistentDataPath : 사용자디렉토리/AppData/LocalLow/회사이름/프로덕트이름
파일 읽기 쓰기 가능
Application.dataPath : 프로젝트디렉토리/Assets
Application.streamingAssetsPath : 프로젝트디렉토리/Assets/StreamingAssets
파일 읽기 쓰기 가능


[윈도우 응용프로그램]
Application.persistentDataPath : 사용자디렉토리/AppData/LocalLow/회사이름/프로덕트이름
파일 읽기 쓰기 가능
Application.dataPath : 실행파일/실행파일_Data
Application.streamingAssetsPath : 실행파일/실행파일_Data/StreamingAssets
파일 읽기 쓰기 가능

[맥 에디터]
Application.persistentDataPath : 사용자디렉토리/Library/Caches/unity.회사이름.프로덕트이름
파일 읽기 쓰기 가능
Application.dataPath : 프로젝트디렉토리/Assets
Application.streamingAssetsPath : 프로젝트디렉토리/Assets/StreamingAssets
파일 읽기 쓰기 가능

[맥 응용프로그램]
Application.persistentDataPath : 사용자디렉토리/Library/Caches/unity.회사이름.프로덕트이름
파일 읽기 쓰기 가능
Application.dataPath : 실행파일.app/Contents
Application.streamingAssetsPath : 실행파일.app/Contents/Data/StreamingAssets
파일 읽기 쓰기 가능

[웹 플랫폼]
웹에서는 명시적인 파일 쓰기 불가능. 애셋번들로 해야함
Application.persistentDataPath : /
Application.dataPath : unity3d파일이 있는 폴더
Application.streamingAssetsPath : 값 없음.

[안드로이드 External]
Application.persistentDataPath : /mnt/sdcard/Android/data/번들이름/files
파일 읽기 쓰기 가능
Application.dataPath : /data/app/번들이름-번호.apk
Application.streamingAssetsPath : jar:file:///data/app/번들이름.apk!/assets 
파일이 아닌 WWW로 읽기 가능

[안드로이드 Internal] 
Application.persistentDataPath : /data/data/번들이름/files/
파일 읽기 쓰기 가능
Application.dataPath : /data/app/번들이름-번호.apk
Application.streamingAssetsPath : jar:file:///data/app/번들이름.apk!/assets
파일이 아닌 WWW로 읽기 가능

[iOS]
Application.persistentDataPath : /var/mobile/Applications/프로그램ID/Documents 
파일 읽기 쓰기 가능
Application.dataPath : /var/mobile/Applications/프로그램ID/앱이름.app/Data
Application.streamingAssetsPath : /var/mobile/Applications/프로그램ID/앱이름.app/Data/Raw 
파일 읽기 가능, 쓰기 불가능



Application.temporaryCachePath 도 있습니다 

윈도우 : %LocalAppData%/Local/Temp/Temp/%Company%/%Product% 
Android Internal : /data/data/%BundleIdentifier%/cache 
Android External : /mnt/sdcard/Android/data/%BundleIdentifier%/cache 
iOS : /var/mobile/Applications/프로그램ID/Library/Caches 



출처 : http://unitystudy.net/bbs/board.php?bo_table=dustin&wr_id=357

반응형
Posted by blueasa
, |

For the game project that I'm currently working on, I needed to find an easy way to color individual characters in the text of an NGUI UILabel.

Fortunately, the solution is pretty simple. When the supportEncoding boolean field on a UILabel is set to true, the text supports color encoding in the[RRGGBB] format.

This means that we can have write text such as the following (the [-] is used to revert to a previous color):

[FF0000]Red[-] [00FF00]Green[-] [0000FF]Blue[-]



The reason I needed to do this was because we want the leading zeros in the Score UILabel to have a different colour than the actual score. And for that, I wrote this neat little method to format my current score to a string with a predefined number of leading zeros and then color those leading zeros independent from the main colour of the label text.

1
2
3
4
5
6
7
8
9
10
11
12
private string FormatScore(int score, string leadingZerosRGBColor, int totalDigits)
{
    var scoreString = score.ToString(CultureInfo.InvariantCulture);
    var zeros = totalDigits - scoreString.Length;
    if (score == 0)
    {
        scoreString = String.Empty;
        zeros++;
    }

    return String.Format("[{0}]{1}[-]{2}", leadingZerosRGBColor, new string('0', zeros <= 0 ? 0 : zeros), scoreString);
}



[출처] http://blog.dreasgrech.com/2013/05/coloring-individual-characters-in-ngui.html

반응형

'Unity3D > NGUI' 카테고리의 다른 글

NGUI Emoticons  (0) 2015.02.12
NGUI UILabel로 Emoticon 넣기..  (0) 2015.02.12
NGUI UILabel Reference  (0) 2014.12.31
NGUI UILabel BBCode  (0) 2014.12.31
PSD Layers to PNG Files(PSD2PNGs)  (0) 2014.12.31
Posted by blueasa
, |

NGUI UILabel Reference

Unity3D/NGUI / 2014. 12. 31. 14:40

Overview

UILabel is a Widget that can be used to display text.



All labels require a Font to work with. This font can be Dynamic (directly referencing a Unity Font), or it can be a Bitmap font -- a font embedded within an Atlas. Dynamic fonts are more robust as they don't require you to pre-generate your glyphs before hand, but Bitmap fonts can be drawn within the same draw call as the rest of your atlas, and can be decorated nicely in an image editing tool such as Photoshop.

You can change the alignment of the labels simply by switching the Pivot point. Top-left, Left and Bottom-left pivot point will result in a left-aligned text. Top, Center, or Bottom alignment will cause the text to be centered, and Top-right, Right or Bottom-right pivot will make your text right-aligned.

With the Dynamic font chosen you can set the Font Size as well as style directly on your label. You can also set the material that will be used to draw it, if you wish.

The big box is -- as you probably guessed -- where you enter text. It's a multi-line text box by default, unless limited by the Max Lines property below it.

Overflow handling lets you determine what happens when the label's text exceeds the allowed space.


  • Shrink Content means the content will be automatically shrunk to best fit the area. It works in conjunction with the Keep Crisp setting if you are using a Dynamic font, making the font size shrink down, not just scaling the content. This results in crisp labels regardless of whether they were shrunk or not.
  • Clamp Content simply means that if the text doesn't fit, it will be cut off.
  • Resize Freely option will make the label's dimensions controlled by the text entered in the field. You won't be able to resize the dimensions yourself.
  • The last option, Resize Height will add grow the height as necessary, but will keep the width constant.

The Spacing field lets you adjust the distance between characters. Both positive and negative values are allowed. This value is in pixels.

Max Lines, as mentioned earlier, lets you control how many lines you want there to be at maximum. You can leave it at zero if you want it to be unlimited.

You can turn off Encoding if you don't want color tags and emoticons to be processed. Input fields do this by default.

If you want, you can give your labels a Gradient by specifying the bottom and top colors.

You can give your text a shadow or an outline Effect, but note that doing so will double the geometry in case of shadow, and multiply it by a factor of 5 in case of outline -- so be mindful of this feature. The Distance parameter controls how far the shadow or outline is from the base text, in pixels.

To change the label's text at run-time, you can do the following:

Code: [Select]
UILabel lbl = GetComponent<UILabel>();
lbl.text = "Hello world!";


Pro-Tip #1

You can add bold, italic, underline, and other effects to your label by using bbcode syntax like so:

[b]bold[/b]
[i]italic[/i]
[u]underline[/u]
[s]strikethrough[/s]

You can also embed clickable links in your labels like so:

[url=Some Message or Link]Click Me[/url]

To retrieve what you clicked on, attach a box collider to your label (ALT+SHIFT+C) and a script that has a function like this in it:

Code: [Select]
void OnClick ()
{
    UILabel lbl = GetComponent<UILabel>();
    string url = lbl.GetUrlAtPosition(UICamera.lastWorldPosition);
    Debug.Log("Clicked on: " + url);
}


Pro-Tip #2

You can give your labels a beveled look by specifying a dark foreground color and a bright Shadow effect.



Pro-Tip #3

You can make the text ignore the label's color tint by using the [c]text here[/c]tag, and change the alpha by using [Aa] syntax, like "[7f]".

Class Documentation

http://tasharen.com/ngui/docs/class_u_i_label.html


출처 : http://www.tasharen.com/forum/index.php?topic=6706.0

반응형

'Unity3D > NGUI' 카테고리의 다른 글

NGUI UILabel로 Emoticon 넣기..  (0) 2015.02.12
Coloring individual characters in an NGUI UILabel text  (0) 2014.12.31
NGUI UILabel BBCode  (0) 2014.12.31
PSD Layers to PNG Files(PSD2PNGs)  (0) 2014.12.31
PSD Layers to 2D Tool Kit(PSD2TK2D)  (0) 2014.12.31
Posted by blueasa
, |

NGUI UILabel BBCode

Unity3D/NGUI / 2014. 12. 31. 14:15

The use of Unity3d NGUI (two) (UILabel Chinese font and click on the font)

Unity3d NGUI can create font can click effect, click on the open web links

There are Chinese font display, can direct call system built-in fonts, does not need the third party font support


UILabel (Script parameters)


The first font options, NGUI is using a static font, when we need to show Chinese, it is best to use dynamic fonts, or you can create static font set

Font Size: font size

Material: The font textures, such as the need for font color

Text: Display content

Overflow: Filler content options, 1, ShrinkContent (content based filling) 2, ClampContent (in the font for the base shear)

3, ResizeFreely (content as the base level for filling) 4, with content high as reference for filling

Alignment: Alignment, font

Keep crisp: Dynamic font sharpening

Gradient: Font change

Effect: The fonts

Spaceing: Font spacing

Max Lines: The number of rows to display font

BBCode: Use the NGUI custom formatting font font


1, Create Chinese font

A. first creates a UILabel in Widget Tool

B. in the NGUI inspector window, select Unity UILabel, then select Font-Arial

C. We are now using dynamic fonts, can display Chinese


2, Create a link font

A. need to add the click event UILabel add a Script

	void OnClick ()
	{
		UILabel lbl = GetComponent<UILabel>();
		
		if (lbl != null)
		{
			string url = lbl.GetUrlAtPosition(UICamera.lastHit.point);
			if (!string.IsNullOrEmpty(url)) Application.OpenURL(url);
		}
	}

The B. for the current UILabel add a Box Collider, adjust the Box Collider size for the current UILabel window size 

The Is Trigger option is on the hook


C. NGUI currently supports formatting font three, 1 ([b]bold[/b] display effect dynamic font changes) 2 ([u]underline[/u] underline

[s]strikethrough[/s] Delete line) 3 ([url=http://www.tasharen.com/][u]clickable hyperlinks[/u][/url] add a web link)


Show all formatting, click clickable to open the link



The use of Unity3d NGUI (two) (UILabel Chinese font and click on the font)


출처 : http://www.programering.com/a/MTO2gDNwATU.html

반응형

'Unity3D > NGUI' 카테고리의 다른 글

Coloring individual characters in an NGUI UILabel text  (0) 2014.12.31
NGUI UILabel Reference  (0) 2014.12.31
PSD Layers to PNG Files(PSD2PNGs)  (0) 2014.12.31
PSD Layers to 2D Tool Kit(PSD2TK2D)  (0) 2014.12.31
PSD Layers to NGUI(PSD2NGUI)  (0) 2014.12.31
Posted by blueasa
, |


홈페이지 링크 : http://www.magicnreal.com/



PSD Layers to PNG Files

카테고리:에디터 익스텐션/유틸리티
퍼블리셔:Magic n Real
평가하기:
평가가 충분하지 않습니다

가격:$10

이 익스텐션은 사용하는 유니티당 하나씩의 라이센스가 필요합니다.

유니티 3.4.2 이상의 버전이 필요합니다.

Extracts PSD layers from your Photoshop files directly to PNG files in Unity!
A fantastic time-saving utility!

Email: gblue1223@gmail.com
Forum


반응형

'Unity3D > NGUI' 카테고리의 다른 글

NGUI UILabel Reference  (0) 2014.12.31
NGUI UILabel BBCode  (0) 2014.12.31
PSD Layers to 2D Tool Kit(PSD2TK2D)  (0) 2014.12.31
PSD Layers to NGUI(PSD2NGUI)  (0) 2014.12.31
NGUI - scroll view 재사용 객체  (0) 2014.12.16
Posted by blueasa
, |

홈페이지 링크 : http://www.magicnreal.com/


에셋스토어 링크 : https://www.assetstore.unity3d.com/kr/#!/content/2842



PSD Layers to 2D Tool Kit

카테고리:에디터 익스텐션/유틸리티
퍼블리셔:Magic n Real
평가하기:
(4)

가격:$20

이 익스텐션은 사용하는 유니티당 하나씩의 라이센스가 필요합니다.

유니티 4.5.0 이상의 버전이 필요합니다.

Convert PSD layers to 2D Toolkit Sprite format in just one click!

Check the screen shots below for more information. Easy-to-use and intuitive
interface.

Important: You must have 2D Toolkit to use this.
Note: Now It's support 2D Tool Kit 2.4 and Unity4.5

Email: gblue1223@gmail.com
Forum


반응형

'Unity3D > NGUI' 카테고리의 다른 글

NGUI UILabel BBCode  (0) 2014.12.31
PSD Layers to PNG Files(PSD2PNGs)  (0) 2014.12.31
PSD Layers to NGUI(PSD2NGUI)  (0) 2014.12.31
NGUI - scroll view 재사용 객체  (0) 2014.12.16
NGUI용 Virtual Joystick Script「UIJoystick」  (0) 2014.08.04
Posted by blueasa
, |

링크 : http://www.magicnreal.com/psd2ngui/


유니티에셋 링크 : https://www.assetstore.unity3d.com/kr/#!/content/11220



요약

PSD2NGUI 를 이용해주셔서 감사합니다.
PSD2NGUI 는 NGUI 를 위한 자동화 툴입니다. PSD2NGUI 는 PSD Layer 들을 NGUI Widget 들로 바꾸어 줍니다. 예를 들어 label, editbox, button, checkbox, scrollview, 등을 PSD Layer 에 간단한 명령어를 삽입하는 것만으로 만들 수 있습니다. 그리고 작업자가 PSD 파일을 수정했을 때, Unity3D 에서도 수정한 결과가 그대로 반영됩니다. PSD2NGUI 를 사용한다면, 더이상 Atlas Maker, Widget, Font 툴을 이용하지 않고 편리하게 GUI 를 만들 수 있습니다. 또한 이미지를 자르기 위해 Sprite 를 세팅할 필요도 없습니다. PSD Layer 에 Slice 명령어만 붙여주면 됩니다. PSD2NGUI 를 이용하면 GUI 를 개발하는데 걸리는 시간을 굉장히 절약하실 수 있게 될겁니다.

중요: PSD2NGUI 는 NGUI(2.2.7 ~ 3.0.2) 가 있어야 작동합니다.
노트: PSD2NGUI 는 PhotoShop 없이도 사용 가능합니다.
노트: PSD2NGUI 는 PhotoShop 의 ’스마트 오브젝트 레이어’, ’라스터 이미지 레이어’, ’텍스트 레이어’ 만 지원합니다.

사용법

1. 열기

a. PSD 파일위에서 마우스 오른쪽 버튼을 클릭하면 PSD2NGUI 를 열 수 있습니다.

b. NGUI 메뉴에서 마우스 오른쪽 버튼을 클릭하면 PSD2NGUI 를 열 수 있습니다.

2. PSD 파일 추가

a. PSD Layer 에 명령어를 추가 합니다.

3. 작업 실행

a. RUN 버튼 실행.

4. 메뉴 설명

  • Load
    PSD2NGUI 설정을 로드합니다.
  • Delete
    PSD2NGUI 설정을 삭제합니다.
  • Run
    PSD Layer 를 NGUI 로 변환합니다.
  • NGUI Root
    NGUI 의 UIRoot 를 링크합니다. Run 으로 변환을 시작하면 자동으로 링크됩니다.
  • Camera
    NGUI 의 카메라 종류를 설정 합니다.
  • Target Screen Size
    배포될 디바이스의 화면 사이즈를 설정 합니다.
  • Add Font
    비트맵 폰트를 추가합니다.
  • Font Data
    비트맵 폰트 이미지의 단어별 위치 정보가 있는 텍스트파일을 넣는 곳입니다.
  • Font Texture
    비트맵 폰트의 이미지를 넣는 곳입니다.
  • Font Prefab
    생성된 NGUI 폰트의 프리팹이 들어가는 곳입니다.
    만약 [Font Data], [Font Texture] 둘중 하나라도 설정 되어있지 않으면 생성되지 않으며, 이미 존재하는 프리팹을 넣을 수도 있습니다.
    반대로, 모두 설정 되어있으면 프리팹이 생성되며, 이미 존재하는 프리팹은 새로운 데이터로 교채 됩니다.
  • Assign Font To All Labels
    NGUI Root 의 모든 자식 UILabel 에 [Font Prefab] 에서 설정한 프리팹을 넣어줍니다.
    이미 폰트가 설정되어있는 UILabel 은 무시합니다.
  • Remove Font To All Labels
    NGUI Root 의 모든 자식 UILabel 에서 폰트 설정을 삭제합니다.
  • Use One Atlas
    하나의 아트라스에 모든 이미지를 넣습니다.
    체크를 해제하면 PSD 파일별로 아트라스를 생성하게 됩니다.
  • Keep Old Sprites
    체크를 해제하면 기존의 아틀라스에 있던 이미지들은 삭제됩니다.
  • Create Controls
    체크를 해제하면 아트라스와 폰트만 만들게 됩니다.
  • Remove All
    모든 PSD 파일을 목록에서 제거합니다. 실제 파일은 지워지지 않습니다.
  • Add Font All
    아트라스를 PSD 파일마다 개별로 만들 때 각 아틀라스에 폰트 추가옵션을 한꺼번에 킨다.
  • Remove Font All
    아트라스를 PSD 파일마다 개별로 만들 때 각 아틀라스에 폰트 추가옵션을 한꺼번에 끈다.

비디오

a. 기본 사용법.

명령어

* Sub commands : 컨트롤 들을 추가 적으로 꾸미기 위한 용도로 사용하며, Label, Button, ComboBox 는 추가 하지 않아도 상관 없다.
  • Sprite

     
    ex) layerName
    만약 커맨드명이 없다면 PSD2NGUI 는 Sprite 로 가정합니다.
  • Slice

     
    ex) layerName@slice=(LeftTop)x(RightTop)x(LeftBottom)x(RightBottom)
    Layer 이름을 layerName@slice=2x2x2x2 와 같이 설정하면, PSD2NGUI 는 Layer 의 가장자리를 2픽셀의 정사각형으로 잘라낼 것입니다. 결과적으로 이미지 크기는 4x4 가 됩니다.
    Layer 이름을 layerName@slice=50%x50%x10%x10% 와 같이 설정하면. PSD2NGUI 는 백분율을 픽셀로 치환하고, 잘라낼 것입니다.
    만약 잘라낼 크기가 모두 같다면 layerName@slice=2 와 같이 한곳만 설정해줘도 됩니다.

  • Panel

     
    ex) groupName@panel
    PSD2NGUI 는 UIPanel 을 만들 것입니다. 명령어를 Group(Folder)에 해야합니다.
  • Label

     
    ex) layerName@label(혹은 명령어 없이 Text Layer)
    PSD2NGUI 는 UILabel 을 만들 것입니다.
    Sub commands.
     sameLayerName@label@color=black, layerName@label@color=ff00ff : 컬러설정
     sameLayerName@label@bold=true : 폰트를 굵게
     sameLayerName@label@shadow=true : 폰트에 그림자 추가
     sameLayerName@label@text=Hello PSD2NGUI : 보여질 문장
     sameLayerName@label@align=[topleft, top, topright, left, center, right, bottomleft, bottom, bottomright] : 텍스트 align(pivot)

     sameLayerName@label@fontsize=14 : 픽셀단위 폰트 크기
  • Button

     
    ex) layerName@button
    PSD2NGUI 는 UIButton 을 만들 것입니다.
    만일 button.hover 혹은 button.pressed 와 같은 sub-commands 가 있다면 PSD2NGUI 는 UIImageButton 을 만들 것입니다.
    Sub commands.
     sameLayerName@button.hover : 마우스오버 상태일때의 이미지
     sameLayerName@button.pressed : 마우스가 눌려졌을때의 이미지
     sameLayerName@button.label : 버튼의 제목
  • LabelButton

     
    ex) textLayer@button
    PSD2NGUI 는 글자만 있는 UIButton 을 만들 것입니다.
  • Toggle(Checkbox)

     
    ex) layerName@toggle, layerName@checkbox
    PSD2NGUI 는 UIToggle(UICheckBox) 를 만들 것입니다.
    Sub commands.
     sameLayerName@toggle(checkbox).checked : 체크되었을 때의 이미지
  • Input(EditBox)

     
    ex) layerName@input, layerName@editbox
    PSD2NGUI 는 UIEditBox 를 만들 것입니다.
  • Password

     
    ex) layerName@password
    PSD2NGUI 는 UIEditBox 를 만들고 Password 옵션을 켜둘 것입니다.
  • ComboBox

     
    ex) layerName@combobox
    PSD2NGUI 는 UIComboBox 를 만들 것입니다.
    Sub commands.
     sameLayerName@combobox.bar : 콤보박스 아이템 선택 이미지
     sameLayerName@combobox.listbg : 콤보박스 배경 이미지
  • Slider

     
    ex) layerName@hslider or layerName@vslider
    PSD2NGUI 는 UISlider 를 만들 것입니다.(Slider).
    Sub commands.
     sameLayerName@h(or v)slider.fg : Slider 의 Bar 이미지 입니다.
  • ProgressBar

     
    ex) layerName@hprogressbar or layerName@vprogressbar
    PSD2NGUI will make UISlider(Progress Bar).
    Sub commands.
     sameLayerName@h(or v)progressbar.fg : ProgressBar 의 foreground(bar) 이미지 입니다.
  • ScrollBar

     
    ex) layerName@hscrollbar or layerName@vscrollbar
    PSD2NGUI will make UIScrollBar.
    Sub commands.
     sameLayerName@h(or v)scrollbar.fg : ScrollBar 의 foreground(bar) 이미지 입니다.
  • ScrollView

     
    ex) layerName@scrollview
    PSD2NGUI 는 UIDraggablePanel 과 UIDragPanelContents 를 만들 것입니다.
    Sub commands.
     sameLayerName@scrollview.item : ScrollView 아이템. 안에는 다른 Widget 들이 들어갈 수 있습니다.
     sameLayerName@h(or v)scrollbar.bg : ScrollBar 의 background(bar) 이미지 입니다.
     sameLayerName@h(or v)scrollbar.fg : ScrollBar 의 foreground(bar) 이미지 입니다.

  • VirtualView

     
    ex) layerName@virtualview
    PSD2NGUI 는 PsdLayerVirtualView 를 만들 것입니다. ScrollView 와 다른 점은 UI 와 Data 가 분리 되었기 때문에, 방대한 데이터도 사용 가능합니다.
    Sub commands.
     sameLayerName@virtualview.item : ScrollView 아이템. 안에는 다른 Widget 들이 들어갈 수 있습니다.
     sameLayerName@h(or v)scrollbar.bg : ScrollBar 의 background(bar) 이미지 입니다.
     sameLayerName@h(or v)scrollbar.fg : ScrollBar 의 foreground(bar) 이미지 입니다.

  • SpriteFont

     
    ex) groupName@spritefont
    PSD2NGUI 는 PsdLayerSpriteFont 를 만들 것입니다. Sprite 가 간단한 폰트처럼 사용될 것입니다.

  • Animation

     
    ex) gropuName@animation@fps=30 or groupName@ani@fps=15
    PSD2NGUI 는 PsdLayerSpriteAnimation 를 만들 것입니다. 매우 단순한 애니메이션 클래스 입니다.
  • Collider

     
    ex) layerName@collider=box
    PSD2NGUI 는 BoxCollider 를 만들 것입니다. Sprite 혹은 Label 에만 적용됩니다.
  • Script

     
    ex) textLayer@script
    PSD2NGUI 는 PsdLayerUserScript 를 만들 것입니다. 멤버 변수로 data 가 있고, data 의 값은 PSD Text Layer 에서 입력했던 문자열이 들어가게 됩니다.
  • Ignore

     
    ex) layerName@ignore
    만약 Layer 에 Ignore 명령어가 붙게되면 레이어를 로드하지 않을 것입니다.

지원

Forum: PSD2NGUI


반응형
Posted by blueasa
, |