Class Button
버튼을 담당하는 GUI 클래스
네임스페이스: Game.Scripts.UI
어셈블리: Assembly-CSharp.dll
Syntax
[MoonSharpUserData]
public class Button : Control, IPointerHandler
생성자
Button(Rect)
버튼을 담당하는 GUI 클래스
선언
public Button(Rect rect = null)
매개 변수(인자)
타입 | 이름 | 설명 |
---|---|---|
Rect | rect |
Button(RectTransform, Button)
버튼을 담당하는 GUI 클래스
선언
public Button(RectTransform rt, Button original)
매개 변수(인자)
타입 | 이름 | 설명 |
---|---|---|
UnityEngine.RectTransform | rt | |
Button | original |
변수
_button
버튼을 담당하는 GUI 클래스
선언
public Button _button
필드 값
타입 | 설명 |
---|---|
UnityEngine.UI.Button |
프로퍼티
autoTranslate
Text 자동 번역 여부 true : 자동 번역 기능을 활성화
선언
public bool autoTranslate { get; set; }
프로퍼티 값
타입 | 설명 |
---|---|
bool |
color
버튼의 색상
선언
public Color color { get; set; }
프로퍼티 값
타입 | 설명 |
---|---|
Color |
colors
버튼의 컬러를 설정합니다.
선언
public ColorBlock colors { get; set; }
프로퍼티 값
타입 | 설명 |
---|---|
ColorBlock |
font
폰트를 설정합니다.
선언
public Font font { get; set; }
프로퍼티 값
타입 | 설명 |
---|---|
Font |
fontStyle
폰트 스타일 0 : Normal 1 : Bold 2 : Italic 3 : Bold and Italic
선언
public int fontStyle { get; set; }
프로퍼티 값
타입 | 설명 |
---|---|
int |
horizontalOverflow
Text 가로 영역을 넘어선 글의 처리 방식 true : 가로 범위를 넘어가도록 허용 false : 다음 행으로 내려쓰기
선언
public bool horizontalOverflow { get; set; }
프로퍼티 값
타입 | 설명 |
---|---|
bool |
imageType
이미지 출력방식변경
Simple = 0,
Sliced = 1,
Tiled = 2,
Filled = 3
선언
public int imageType { get; set; }
프로퍼티 값
타입 | 설명 |
---|---|
int |
lineSpacing
텍스트 행의 간격입니다.
선언
public float lineSpacing { get; set; }
프로퍼티 값
타입 | 설명 |
---|---|
float |
onClick
클릭시(눌렀다가 뗐을 때) 호출되는 이벤트
선언
public EventPublisher onClick { get; }
프로퍼티 값
타입 | 설명 |
---|---|
EventPublisher |
onDragEnd
드래그가 끝났을 때 호출되는 이벤트
선언
public EventPublisher onDragEnd { get; }
프로퍼티 값
타입 | 설명 |
---|---|
EventPublisher |
onDragStart
드래그를 시작할 때 호출되는 이벤트
선언
public EventPublisher onDragStart { get; }
프로퍼티 값
타입 | 설명 |
---|---|
EventPublisher |
onMouseDown
눌렀을 때 호출되는 이벤트
선언
public EventPublisher onMouseDown { get; }
프로퍼티 값
타입 | 설명 |
---|---|
EventPublisher |
onMouseEnter
마우스가 버튼에 들어왔을때 호출 되는 이벤트
선언
public EventPublisher onMouseEnter { get; }
프로퍼티 값
타입 | 설명 |
---|---|
EventPublisher |
onMouseExit
마우스가 버튼에서 나갔을때 호출 되는 이벤트
선언
public EventPublisher onMouseExit { get; }
프로퍼티 값
타입 | 설명 |
---|---|
EventPublisher |
onMouseUp
버튼을 뗐을 때 호출되는 이벤트
선언
public EventPublisher onMouseUp { get; }
프로퍼티 값
타입 | 설명 |
---|---|
EventPublisher |
raycastTarget
버튼의 raycastTarget 속성.
선언
public bool raycastTarget { get; set; }
프로퍼티 값
타입 | 설명 |
---|---|
bool |
sliceBorder
9슬라이스에 필요한 이미지 테두리 값.
선언
public RectOff sliceBorder { get; set; }
프로퍼티 값
타입 | 설명 |
---|---|
RectOff |
text
버튼 텍스트
선언
public string text { get; set; }
프로퍼티 값
타입 | 설명 |
---|---|
string |
textAlign
버튼 텍스트 정렬
선언
public int textAlign { set; }
프로퍼티 값
타입 | 설명 |
---|---|
int |
textColor
버튼 텍스트 색상
선언
public Color textColor { get; set; }
프로퍼티 값
타입 | 설명 |
---|---|
Color |
textSize
버튼 텍스트 크기
선언
public int textSize { get; set; }
프로퍼티 값
타입 | 설명 |
---|---|
int |
verticalOverflow
Text 세로 영역을 넘어선 글의 처리 방식 true : 세로 범위를 넘어가도록 허용 false : 넘어간 글자는 잘라내어 미표시
선언
public bool verticalOverflow { get; set; }
프로퍼티 값
타입 | 설명 |
---|---|
bool |
함수
__call(Button, Dictionary<string, object>)
버튼을 담당하는 GUI 클래스
선언
[MoonSharpUserDataMetamethod("__call")]
public static Button __call(Button self, Dictionary<string, object> style)
매개 변수(인자)
타입 | 이름 | 설명 |
---|---|---|
Button | self | |
System.Collections.Generic.Dictionary<TKey, TValue><string, object> | style |
반환
타입 | 설명 |
---|---|
Button |
__call(object, Rect)
버튼을 담당하는 GUI 클래스
선언
[MoonSharpUserDataMetamethod("__call")]
public static Button __call(object self, Rect rect)
매개 변수(인자)
타입 | 이름 | 설명 |
---|---|---|
object | self | |
Rect | rect |
반환
타입 | 설명 |
---|---|
Button |
__call(object, string, Rect)
버튼을 담당하는 GUI 클래스
선언
[MoonSharpUserDataMetamethod("__call")]
public static Button __call(object self, string text, Rect rect)
매개 변수(인자)
타입 | 이름 | 설명 |
---|---|---|
object | self | |
string | text | |
Rect | rect |
반환
타입 | 설명 |
---|---|
Button |
__pairs(Button)
버튼을 담당하는 GUI 클래스
선언
[MoonSharpUserDataMetamethod("__pairs")]
public static DynValue __pairs(Button self)
매개 변수(인자)
타입 | 이름 | 설명 |
---|---|---|
Button | self |
반환
타입 | 설명 |
---|---|
MoonSharp.Interpreter.DynValue |
SetButtonColors(Color, Color, Color, Color, Color)
버튼의 색을 설정합니다.
선언
public void SetButtonColors(Color normalColor, Color highlightedColor, Color pressedColor, Color selectedColor, Color disabledColor)
매개 변수(인자)
타입 | 이름 | 설명 |
---|---|---|
Color | normalColor | 일반 컬러 |
Color | highlightedColor | 하이라이트 컬러 |
Color | pressedColor | 눌렀을때 컬러 |
Color | selectedColor | 선택 되었을때 컬러 |
Color | disabledColor | 비활성시 컬러 |
SetButtonColors(ColorBlock)
버튼의 색을 설정합니다.
선언
public void SetButtonColors(ColorBlock colorBlock)
매개 변수(인자)
타입 | 이름 | 설명 |
---|---|---|
ColorBlock | colorBlock | 컬러 블록 |
SetImage(string)
이미지 변경
선언
public void SetImage(string path = "")
매개 변수(인자)
타입 | 이름 | 설명 |
---|---|---|
string | path | 경로 |
SetOutline(Color)
텍스트의 outline 지정
선언
public void SetOutline(Color color)
매개 변수(인자)
타입 | 이름 | 설명 |
---|---|---|
Color | color | 컬러 |
SetSpriteByPath(string)
패스로 이미지의 스프라이트 지정
선언
public void SetSpriteByPath(string path)
매개 변수(인자)
타입 | 이름 | 설명 |
---|---|---|
string | path | 경로 |