@@ -32,6 +32,32 @@ public GTextField()
32
32
_textField . wordWrap = false ;
33
33
}
34
34
35
+ public override BlendMode blendMode
36
+ {
37
+ get
38
+ {
39
+ if ( displayObject != null )
40
+ {
41
+ return displayObject . blendMode ;
42
+ }
43
+ else
44
+ {
45
+ #if FAIRYGUI_TMPRO
46
+ return BlendMode . One_OneMinusSrcAlpha ;
47
+ #else
48
+ return BlendMode . None ;
49
+ #endif
50
+ }
51
+ }
52
+ set
53
+ {
54
+ if ( displayObject != null )
55
+ {
56
+ displayObject . blendMode = value ;
57
+ }
58
+ }
59
+ }
60
+
35
61
override protected void CreateDisplayObject ( )
36
62
{
37
63
_textField = new TextField ( ) ;
@@ -166,9 +192,11 @@ protected string ParseTemplate(string template)
166
192
if ( ! _templateVars . TryGetValue ( tag , out value ) )
167
193
value = "" ;
168
194
}
195
+
169
196
buffer . Append ( value ) ;
170
197
pos1 = pos2 + 1 ;
171
198
}
199
+
172
200
if ( pos1 < template . Length )
173
201
buffer . Append ( template , pos1 , template . Length - pos1 ) ;
174
202
@@ -180,10 +208,7 @@ protected string ParseTemplate(string template)
180
208
/// </summary>
181
209
public TextFormat textFormat
182
210
{
183
- get
184
- {
185
- return _textField . textFormat ;
186
- }
211
+ get { return _textField . textFormat ; }
187
212
set
188
213
{
189
214
_textField . textFormat = value ;
@@ -197,10 +222,7 @@ public TextFormat textFormat
197
222
/// </summary>
198
223
public Color color
199
224
{
200
- get
201
- {
202
- return _textField . textFormat . color ;
203
- }
225
+ get { return _textField . textFormat . color ; }
204
226
set
205
227
{
206
228
if ( _textField . textFormat . color != value )
@@ -362,7 +384,7 @@ override protected void HandleSizeChanged()
362
384
{
363
385
if ( _textField . autoSize == AutoSizeType . Height )
364
386
{
365
- displayObject . width = this . width ; //先调整宽度,让文本重排
387
+ displayObject . width = this . width ; //先调整宽度,让文本重排
366
388
if ( _text != string . Empty ) //文本为空时,1是本来就不需要调整, 2是为了防止改掉文本为空时的默认高度,造成关联错误
367
389
SetSizeDirectly ( this . width , displayObject . height ) ;
368
390
}
@@ -435,4 +457,4 @@ override public void Setup_AfterAdd(ByteBuffer buffer, int beginPos)
435
457
this . text = str ;
436
458
}
437
459
}
438
- }
460
+ }
0 commit comments