Class: Text

Text


new Text(configs)

可以绘制文字

Parameters:
Name Type Description
configs Text~TextConfigs

配置

Extends

Members


absolutePosition :Node~AbsolutePosition

Type:
Inherited From:

anchor :Array.<number>

Type:
  • Array.<number>
Inherited From:

border :Rectangle~borders

边框设置,优先级高于 borderWidth,borderColor

Type:
Inherited From:

borderRadius :Number

圆角矩形半径

Type:
  • Number
Inherited From:

content :String

内容

Type:
  • String

editable :Boolean

是否可编辑

Type:
  • Boolean

fontFamily :String

字体

Type:
  • String

fontSize :String

字号

Type:
  • String

fontWeight :String

字体

Type:
  • String

height :Number

Type:
  • Number
Inherited From:
Overrides:

indent :Number

缩进

Type:
  • Number

lineHeight :Number

行高

Type:
  • Number

minWidth :number

最小宽度

Type:
  • number

textAlign :String

文字对齐方式

Type:
  • String

textBaseline :String

文字基线方式

Type:
  • String

textColor :String

字体颜色

Type:
  • String

width :Number

Type:
  • Number
Inherited From:
Overrides:

Methods


_makeEditable()

编辑态


clone()

克隆当前节点.

Inherited From:
Returns:

当前节点的副本

Type
Node

Type Definitions


TextConfigs

文字单元 配置

Type:
Properties:
Name Type Description
fontFamily String

字体

fontSize Number

字号

content String

内容

textColor String

字体颜色

textAlign TEXT_ALIGN

文字对齐方式

backgroundColor String

背景颜色

lineHeight number

行高

indent number

缩进

editable Boolean

是否可编辑

minWidth number

最小宽度

placeholder string

占位文字

emptyWhenInput Boolean

输入状态时是否清空input框

Events


afterResolveMovingTarget

开始拖拽时,拖拽对象设置之前

Type: object
Properties:
Name Type Description
event Event

原始事件

jflow JFlow

当前JFlow对象

target Node

目标节点

Inherited From:

change

文字改变事件

Type: object
Properties:
Name Type Description
target Text

当前文字对象

oldVal String

原始文字

val String

当前文字


drop

丢在节点上事件

Type: object
Properties:
Name Type Description
event Event

原始事件

instance Object

拖动的对象

jflow JFlow

当前JFlow对象

target Node

目标节点

point Array.<number>

已经计算到绘图栈对应坐标系下的坐标

Inherited From:

instancemousemove

instance mousemove 原生事件,仅在无拖拽时触发

Type: object
Properties:
Name Type Description
event Event

原始事件

instance Node

原始事件

jflow JFlow

当前JFlow对象

Inherited From:

instancePressStart

开始拖动对象事件(就是目标对象的拖动事件,事件支持冒泡)

Type: object
Properties:
Name Type Description
event Event

原始事件

instance Node

拖动的对象

jflow JFlow

当前JFlow对象

bubbles Boolean

冒泡

Inherited From:

canvas mousemove 原生事件

Type: object
Properties:
Name Type Description
event Event

原始事件

target Node

原始事件

payload object

传入的消息

jflow JFlow

当前JFlow对象 - 当前JFlow对象

Inherited From:

pressEnd

拖动后放置到 Instance 上的事件,由被拖动到的对象触发

Type: object
Properties:
Name Type Description
event Event

原始事件

instance Node

拖动的对象

jflow JFlow

当前JFlow对象

target Instance

拖动到的对象

bubbles boolean

冒泡

Inherited From:

pressStart

开始拖动组的事件(特指lock的顶层组)

Type: object
Properties:
Name Type Description
event Event

原始事件

instance Node

拖动的对象

jflow JFlow

当前JFlow对象

Inherited From: