/
Label.hx
165 lines (127 loc) · 4.83 KB
/
Label.hx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
// Automatically generated Godot externs: DO NOT EDIT
// MIT licensed, see LICENSE.md
package godot;
import cs.system.*;
/**
Label displays plain text on the screen. It gives you control over the horizontal and vertical alignment and can wrap the text inside the node's bounding rectangle. It doesn't support bold, italics, or other formatting. For that, use `godot.RichTextLabel` instead.
Note: Contrarily to most other `godot.Control`s, Label's `godot.Control.mouseFilter` defaults to `godot.Control_MouseFilterEnum.ignore` (i.e. it doesn't react to mouse input events). This implies that a label won't display any configured `godot.Control.hintTooltip`, unless you change its mouse filter.
Note: Unicode characters after `0xffff` (such as most emoji) are not supported on Windows. They will display as unknown characters instead. This will be resolved in Godot 4.0.
**/
@:libType
@:csNative
@:native("Godot.Label")
@:autoBuild(godot.Godot.buildUserClass())
extern class Label extends godot.Control {
/**
Limits the lines of text the node shows on screen.
**/
@:native("MaxLinesVisible")
public var maxLinesVisible:Int;
/**
The node ignores the first `lines_skipped` lines before it starts to display text.
**/
@:native("LinesSkipped")
public var linesSkipped:Int;
/**
Limits the amount of visible characters. If you set `percent_visible` to 0.5, only up to half of the text's characters will display on screen. Useful to animate the text in a dialog box.
**/
@:native("PercentVisible")
public var percentVisible:Single;
/**
Restricts the number of characters to display. Set to -1 to disable.
**/
@:native("VisibleCharacters")
public var visibleCharacters:Int;
/**
If `true`, all the text displays as UPPERCASE.
**/
@:native("Uppercase")
public var uppercase:Bool;
/**
If `true`, the Label only shows the text that fits inside its bounding rectangle and will clip text horizontally.
**/
@:native("ClipText")
public var clipText:Bool;
/**
If `true`, wraps the text inside the node's bounding rectangle. If you resize the node, it will change its height automatically to show all the text.
**/
@:native("Autowrap")
public var autowrap:Bool;
/**
Controls the text's vertical align. Supports top, center, bottom, and fill. Set it to one of the `godot.Label_VAlign` constants.
**/
@:native("Valign")
public var valign:godot.Label_VAlign;
/**
Controls the text's horizontal align. Supports left, center, right, and fill, or justify. Set it to one of the `godot.Label_AlignEnum` constants.
**/
@:native("Align")
public var align:godot.Label_AlignEnum;
/**
The text to display on screen.
**/
@:native("Text")
public var text:std.String;
@:native("new")
public function new():Void;
@:native("SetAlign")
public function setAlign(align:godot.Label_AlignEnum):Void;
@:native("GetAlign")
public function getAlign():godot.Label_AlignEnum;
@:native("SetValign")
public function setValign(valign:godot.Label_VAlign):Void;
@:native("GetValign")
public function getValign():godot.Label_VAlign;
@:native("SetText")
public function setText(text:std.String):Void;
@:native("GetText")
public function getText():std.String;
@:native("SetAutowrap")
public function setAutowrap(enable:Bool):Void;
@:native("HasAutowrap")
public function hasAutowrap():Bool;
@:native("SetClipText")
public function setClipText(enable:Bool):Void;
@:native("IsClippingText")
public function isClippingText():Bool;
@:native("SetUppercase")
public function setUppercase(enable:Bool):Void;
@:native("IsUppercase")
public function isUppercase():Bool;
/**
Returns the font size in pixels.
**/
@:native("GetLineHeight")
public function getLineHeight():Int;
/**
Returns the amount of lines of text the Label has.
**/
@:native("GetLineCount")
public function getLineCount():Int;
/**
Returns the number of lines shown. Useful if the `godot.Label`'s height cannot currently display all lines.
**/
@:native("GetVisibleLineCount")
public function getVisibleLineCount():Int;
/**
Returns the total number of printable characters in the text (excluding spaces and newlines).
**/
@:native("GetTotalCharacterCount")
public function getTotalCharacterCount():Int;
@:native("SetVisibleCharacters")
public function setVisibleCharacters(amount:Int):Void;
@:native("GetVisibleCharacters")
public function getVisibleCharacters():Int;
@:native("SetPercentVisible")
public function setPercentVisible(percentVisible:Single):Void;
@:native("GetPercentVisible")
public function getPercentVisible():Single;
@:native("SetLinesSkipped")
public function setLinesSkipped(linesSkipped:Int):Void;
@:native("GetLinesSkipped")
public function getLinesSkipped():Int;
@:native("SetMaxLinesVisible")
public function setMaxLinesVisible(linesVisible:Int):Void;
@:native("GetMaxLinesVisible")
public function getMaxLinesVisible():Int;
}