Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
renderingEngine
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王剑峰
renderingEngine
Commits
c04ff844
Commit
c04ff844
authored
Nov 07, 2019
by
wjf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
l
parent
985aecee
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
TextField.ts
src/2d/text/TextField.ts
+8
-10
No files found.
src/2d/text/TextField.ts
View file @
c04ff844
import
{
SCALE_MODES
,
TEXT_ALIGN
,
TEXT_lINETYPE
,
VERTICAL_ALIGN
}
from
"../const"
;
import
{
SCALE_MODES
,
TEXT_ALIGN
,
TEXT_lINETYPE
,
VERTICAL_ALIGN
}
from
"../const"
;
import
Texture
from
"../texture/Texture"
;
import
Texture
from
"../texture/Texture"
;
import
{
getRGBA
}
from
"../utils"
;
import
{
getRGBA
,
hex2string
}
from
"../utils"
;
import
{
Rectangle
}
from
"../math"
;
import
{
Rectangle
}
from
"../math"
;
import
Sprite
from
"../display/Sprite"
;
import
Sprite
from
"../display/Sprite"
;
import
{
Event
}
from
"../events"
;
import
{
Event
}
from
"../events"
;
...
@@ -305,7 +305,7 @@ export class TextField extends Sprite {
...
@@ -305,7 +305,7 @@ export class TextField extends Sprite {
* @since 1.0.0
* @since 1.0.0
* @default #fff
* @default #fff
*/
*/
public
set
fillColor
(
value
:
string
)
{
public
set
fillColor
(
value
:
any
)
{
if
(
this
.
_fillColor
!=
value
)
{
if
(
this
.
_fillColor
!=
value
)
{
this
.
_fillColor
=
value
;
this
.
_fillColor
=
value
;
this
.
dirty
=
true
;
this
.
dirty
=
true
;
...
@@ -313,11 +313,11 @@ export class TextField extends Sprite {
...
@@ -313,11 +313,11 @@ export class TextField extends Sprite {
;
;
}
}
public
get
fillColor
():
string
{
public
get
fillColor
():
any
{
return
this
.
_fillColor
;
return
this
.
_fillColor
;
}
}
private
_fillColor
:
string
=
"#ffffff"
;
private
_fillColor
:
any
=
"#ffffff"
;
/**
/**
* 文本的描边颜色值
* 文本的描边颜色值
...
@@ -451,12 +451,10 @@ export class TextField extends Sprite {
...
@@ -451,12 +451,10 @@ export class TextField extends Sprite {
ctx
.
textAlign
=
s
.
_textAlign
||
TEXT_ALIGN
.
LEFT
;
ctx
.
textAlign
=
s
.
_textAlign
||
TEXT_ALIGN
.
LEFT
;
//暂时没开放
//暂时没开放
ctx
.
textBaseline
=
"top"
;
ctx
.
textBaseline
=
"top"
;
//数字转换
if
(
s
.
_textAlpha
===
1
)
{
if
(
typeof
(
s
.
_fillColor
)
==
"number"
)
s
.
_fillColor
=
hex2string
(
s
.
_fillColor
);
ctx
.
fillStyle
=
s
.
_fillColor
;
//获取fillStyle
}
else
{
ctx
.
fillStyle
=
s
.
_textAlpha
===
1
?
s
.
_fillColor
:
getRGBA
(
s
.
_fillColor
,
s
.
_textAlpha
);
ctx
.
fillStyle
=
getRGBA
(
s
.
_fillColor
,
s
.
_textAlpha
)
}
}
}
/**
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment