m4m.framework.label
@meta4d/engine / Exports / m4m / framework / label
Class: label
language
zh_CN
classdesc
2d文本组件
version
m4m 1.0
Implements
Table of contents
Properties
Constructors
Accessors
Methods
Properties
color
• color: color
language
zh_CN
classdesc
填充颜色
version
m4m 1.0
Defined in
framework/2d/component/label.ts:772
color2
• color2: color
language
zh_CN
classdesc
描边颜色
version
m4m 1.0
Defined in
framework/2d/component/label.ts:783
horizontalOverflow
• horizontalOverflow: boolean
= false
language
zh_CN
classdesc
是否横向溢出
version
m4m 1.0
Defined in
framework/2d/component/label.ts:163
horizontalType
• horizontalType: HorizontalType
= HorizontalType.Left
language
zh_CN
classdesc
水平排列方式
version
m4m 1.0
Defined in
framework/2d/component/label.ts:143
isLabel
• Readonly
isLabel: true
字段 用于快速判断实例是否是label
Defined in
framework/2d/component/label.ts:27
linespace
• linespace: number
= 1
language
zh_CN
classdesc
行高
version
m4m 1.0
Defined in
framework/2d/component/label.ts:133
onAddRendererText
• onAddRendererText: (x
: number
, y
: number
) => void
Type declaration
▸ (x
, y
): void
当需渲染字符被 加入排列时 的回调
Parameters
x
number
y
number
Returns
void
Defined in
framework/2d/component/label.ts:30
outlineWidth
• outlineWidth: number
= 0.75
描边宽度
Defined in
framework/2d/component/label.ts:789
transform
• transform: transform2D
language
zh_CN
classdesc
当前组件的2d节点
version
m4m 1.0
Implementation of
Defined in
framework/2d/component/label.ts:1250
verticalOverflow
• verticalOverflow: boolean
= false
language
zh_CN
classdesc
是否竖向溢出
version
m4m 1.0
Defined in
framework/2d/component/label.ts:173
verticalType
• verticalType: VerticalType
= VerticalType.Center
language
zh_CN
classdesc
垂直排列方式
version
m4m 1.0
Defined in
framework/2d/component/label.ts:153
ClassName
▪ Static
Readonly
ClassName: string
= "label"
Defined in
framework/2d/component/label.ts:25
onTryExpandTexts
▪ Static
onTryExpandTexts: (str
: string
) => void
Type declaration
▸ (str
): void
尝试 动态扩展 字体信息 函数接口
Parameters
str
string
Returns
void
Defined in
framework/2d/component/label.ts:23
Constructors
constructor
• new label()
Accessors
font
• get
font(): font
language
zh_CN
classdesc
字体
version
m4m 1.0
Returns
Defined in
framework/2d/component/label.ts:86
• set
font(font
): void
language
zh_CN
classdesc
字体
version
m4m 1.0
Parameters
font
Returns
void
Defined in
framework/2d/component/label.ts:89
fontsize
• get
fontsize(): number
language
zh_CN
classdesc
字体大小
version
m4m 1.0
Returns
number
Defined in
framework/2d/component/label.ts:118
• set
fontsize(size
): void
language
zh_CN
classdesc
字体大小
version
m4m 1.0
Parameters
size
number
Returns
void
Defined in
framework/2d/component/label.ts:121
imageTextAtlas
• get
imageTextAtlas(): atlas
图像文字图集 (例如 表情)
Returns
Defined in
framework/2d/component/label.ts:814
• set
imageTextAtlas(val
): void
图像文字图集 (例如 表情)
Parameters
val
Returns
void
Defined in
framework/2d/component/label.ts:815
richText
• get
richText(): boolean
富文本模式 , 通过特定标签使用。
文字颜色 <color=#ffffffff>文本 (已经支持); 文字斜体 <i>文本</i> (已经支持); 图片字符(表情) [imgName] (已经支持); 文字加粗 <b>文本</b> (支持中); 文字加下划线 <u>文本</u> (支持中);
Returns
boolean
Defined in
framework/2d/component/label.ts:802
• set
richText(val
): void
富文本模式 , 通过特定标签使用。
文字颜色 <color=#ffffffff>文本 (已经支持); 文字斜体 <i>文本</i> (已经支持); 图片字符(表情) [imgName] (已经支持); 文字加粗 <b>文本</b> (支持中); 文字加下划线 <u>文本</u> (支持中);
Parameters
val
boolean
Returns
void
Defined in
framework/2d/component/label.ts:803
text
• get
text(): string
language
zh_CN
classdesc
文字内容
version
m4m 1.0
Returns
string
Defined in
framework/2d/component/label.ts:44
• set
text(text
): void
language
zh_CN
classdesc
文字内容
version
m4m 1.0
Parameters
text
string
Returns
void
Defined in
framework/2d/component/label.ts:47
Methods
getDrawBounds
▸ getDrawBounds(): rect
language
zh_CN
classdesc
获取渲染绘制矩形边界
version
m4m 1.0
Returns
rect
Implementation of
Defined in
framework/2d/component/label.ts:867
getMaterial
▸ getMaterial(): material
language
zh_CN
classdesc
获取rander 的材质
version
m4m 1.0
Returns
Implementation of
Defined in
framework/2d/component/label.ts:851
onPlay
▸ onPlay(): void
Returns
void
Implementation of
Defined in
framework/2d/component/label.ts:1232
setShaderByName
▸ setShaderByName(shaderName
): void
language
zh_CN
classdesc
设置rander Shader名字
version
m4m 1.0
Parameters
shaderName
string
Returns
void
Defined in
Last updated