Class: FoldLink
折线
// 例如:
import {FoldLink} from "@jtopo/core";
let link = new FoldLink('text', 开始对象, 结束对象, 开始端点, 结束端点);
// 示例1
let link = new FoldLink();
link.text = 'text';
link.setBegin(开始对象, 端点);
link.setEnd(结束对象, 端点);
// 示例2
let link = new FoldLink('text', beginNode, endNode);
let link = new FoldLink('text', beginNode, endNode, 'center', 'center');
let link = new FoldLink('text', beginNode, {x: 10, y:20}, 'center');
let link = new FoldLink('text', {x: 10, y:20}, endNode, 'center');
let link = new FoldLink('text', {x:0, y:0}, {x: 10, y:20});
Hierarchy
↳
FoldLink
Table of contents
Constructors
Properties
- DefaultPositions
- _computedStyle
- _visible
- allwaysSerializers
- beginArrow
- children
- classList
- className
- connectable
- data
- deep
- destroyed
- direction
- draggable
- dropAllowed
- editable
- endArrow
- frozen
- getAnchorPoints
- getCtrlPoints
- inLinks
- isLayer
- isNode
- isSelected
- label
- mouseEnabled
- name
- origin
- outLinks
- paintSelected
- painted
- parent
- pickType
- points
- selectedStyle
- serializeable
- serializers
- shape
- showSelected
- style
- type
- z
Accessors
Methods
- addChild
- addChilds
- addClass
- addEventListener
- attr
- changeParent
- clearCss
- css
- destory
- dispatchEvent
- draw
- drawPoints
- getAABB
- getAllLinks
- getAllNodes
- getBeginArrow
- getBeginPoint
- getChildren
- getComputedStyle
- getEndArrow
- getEndPoint
- getLabel
- getLinks
- getLocalPoint
- getPoint
- getPoints
- getPositionNames
- getRoot
- getSegmentPoints
- getStageTransform
- getStyle
- getTransform
- getUserData
- getWorldTransform
- hasChild
- hasChildren
- hasClass
- hasListener
- hide
- hideAllChild
- isAlone
- isConnected
- isOutOfParent
- isVisible
- nearest
- on
- pickable
- querySelector
- querySelectorAll
- remove
- removeAllChild
- removeAllClass
- removeChild
- removeChilds
- removeClass
- removeEventListener
- removeFromParent
- removeUserData
- screenToLocalVec
- screenToLocalXY
- setBegin
- setBeginArrow
- setBeginOffset
- setEnd
- setEndArrow
- setEndOffset
- setLabel
- setStyles
- setUserData
- setZIndex
- setzIndex
- show
- showAllChild
- stageToLocalVec
- stageToLocalXY
- toJSON
- toLayerXY
- toScreenXY
- toStageXY
- toWorldXY
- transformPoint
- translateWith
- unlink
- unlinkBegin
- unlinkEnd
- updatePoints
- updateZIndex
- updatezIndex
- upgradeParent
- flatten
- getNoChildrensObjects
Constructors
constructor
new FoldLink(text?
, begin?
, end?
, beginEndpointName?
, endEndpointName?
)
Parameters
Name | Type |
---|---|
text? | string |
begin? | PointLike | Node | Link |
end? | PointLike | Node | Link |
beginEndpointName? | ConnectPosition |
endEndpointName? | ConnectPosition |
Overrides
Properties
DefaultPositions
DefaultPositions: any
Inherited from
_computedStyle
Readonly
_computedStyle: Style
层叠样式计算后的
主题、自定义样式类、css方法设置三者叠加后的最终结果
只读,不要修改
Inherited from
_visible
_visible: boolean
Inherited from
allwaysSerializers
allwaysSerializers: string
[]
总会被序列化的属性列表
Inherited from
beginArrow
Optional
beginArrow: Node
开始箭头对象
Inherited from
children
Readonly
children: DisplayObject
[]
子节点集合
Inherited from
classList
Readonly
classList: string
[]
通过addClass添加的样式名称列表
Inherited from
className
className: any
Overrides
connectable
connectable: boolean
是否可连线,仅仅编辑模式有意义
Inherited from
data
Optional
data: any
为了安全考虑,防止与对象属性冲突,用户最好使用该对象 用户附加到该对象的自定义属性
Since
2.4.0
Inherited from
deep
deep: number
层级深度, Layer为0,下面第一层子节点为1,依次类推
Inherited from
destroyed
destroyed: boolean
Inherited from
direction
direction: LinkDirection
= 'horizontal'
方向,有垂直、水平两种 取值为:'horizontal' 或者 'vertical' ,默认为 'horizontal'
draggable
draggable: boolean
是否可拖拽
Inherited from
dropAllowed
dropAllowed: boolean
是否可以作为拖拽目标
Since
2.4.0
Inherited from
editable
editable: boolean
是否可以调整角度、尺寸,仅仅编辑模式有意义
Inherited from
endArrow
Optional
endArrow: Node
结束箭头对象
Inherited from
frozen
frozen: boolean
是否冻结(所有下级子节点)
冻结后鼠标拾取到子节点或者本节点都视为拾取了本节点
Inherited from
getAnchorPoints
getAnchorPoints: Function
Inherited from
getCtrlPoints
getCtrlPoints: Function
Inherited from
inLinks
inLinks: Link
[]
所有以本对象为结束点的Link对象数组
Inherited from
isLayer
Optional
isLayer: boolean
Inherited from
isNode
isNode: boolean
是否是Node对象
Inherited from
isSelected
isSelected: boolean
是否被选中了
Inherited from
label
Optional
label: Node
连线中间的的文本对象(Node), 可能为空.
只有第一次为link.text赋值后,label对象就不为空了。
link.text和 node.text 有差异:
- text 在 Node对象中是一个简单的 字符串属性
- text 在 Link对象中,是 get/set函数,来修改和读取link.label对象的text属性
link.label.text = '123'; 的简写就是:link.text = '123';
Inherited from
mouseEnabled
mouseEnabled: boolean
是否响应鼠标,为false的时候,不响应鼠标的动作
Inherited from
name
Optional
name: string
名称,可以在编辑时指定,运行时通过名称获取对象的引用
Inherited from
origin
origin: number
[]
本地坐标系的原点,采用单位化坐标, 默认为[0,0], 父对象的中心
Inherited from
outLinks
outLinks: Link
[]
所有以本本对为开始点的Link对象数组
Inherited from
paintSelected
Optional
paintSelected: Function
Inherited from
painted
painted: boolean
是否绘制到了最后一帧:是否在当前最新的画布上
Inherited from
parent
Optional
parent: DisplayObject
上级对象
Inherited from
pickType
pickType: PickType
鼠标拾取方式(节点内容,还是整个节点矩形区域)
Inherited from
points
points: PointLike
[]
link相关点坐标集合,link父对象为参考坐标系
Inherited from
selectedStyle
Optional
selectedStyle: Style
选中时的样式,如果不设置将使用默认的
Inherited from
serializeable
serializeable: boolean
是否可序列化,默认true 如果为false,序列化时将跳过该对象
Inherited from
serializers
serializers: string
[]
序列化属性列表
Overrides
shape
shape: Shape
Inherited from
showSelected
showSelected: boolean
是否显示选中的效果,默认显示
Inherited from
style
style: Style
样式
Inherited from
type
Optional
type: string
类型,自定义类型
可用于自定义节点,区分节点类型
比用data属性更方便一点
Since
2.4.0
Inherited from
z
z: number
Inherited from
Accessors
begin
get
begin(): Endpoint
连线的开始对象
Returns
Inherited from
Link.begin
bottom
get
bottom(): number
Since
2.4.0
Returns
number
Inherited from
Link.bottom
set
bottom(v
): void
Parameters
Name | Type |
---|---|
v | number |
Returns
void
Inherited from
Link.bottom
end
get
end(): Endpoint
连线的结束对象
Returns
Inherited from
Link.end
height
get
height(): number
Returns
number
Inherited from
Link.height
set
height(v
): void
Parameters
Name | Type |
---|---|
v | number |
Returns
void
Inherited from
Link.height
left
get
left(): number
Since
2.4.0
Returns
number
Inherited from
Link.left
set
left(v
): void
Parameters
Name | Type |
---|---|
v | number |
Returns
void
Inherited from
Link.left
right
get
right(): number
Since
2.4.0
Returns
number
Inherited from
Link.right
set
right(v
): void
Parameters
Name | Type |
---|---|
v | number |
Returns
void
Inherited from
Link.right
rotation
get
rotation(): any
Returns
any
Inherited from
Link.rotation
set
rotation(v
): void
Parameters
Name | Type |
---|---|
v | any |
Returns
void
Inherited from
Link.rotation
scaleX
get
scaleX(): number
Returns
number
Inherited from
Link.scaleX
set
scaleX(v
): void
Parameters
Name | Type |
---|---|
v | number |
Returns
void
Inherited from
Link.scaleX
scaleY
get
scaleY(): number
Returns
number
Inherited from
Link.scaleY
set
scaleY(v
): void
Parameters
Name | Type |
---|---|
v | number |
Returns
void
Inherited from
Link.scaleY
skewX
get
skewX(): number
Returns
number
Inherited from
Link.skewX
set
skewX(v
): void
Parameters
Name | Type |
---|---|
v | number |
Returns
void
Inherited from
Link.skewX
skewY
get
skewY(): number
Returns
number
Inherited from
Link.skewY
set
skewY(v
): void
Parameters
Name | Type |
---|---|
v | number |
Returns
void
Inherited from
Link.skewY
text
get
text(): string
文本节点的text别名
link.text和 node.text 有差异:
- text 在 Node对象中是一个简单的 字符串属性
- text 在 Link对象中,是 get/set函数,来修改和读取link.label对象的text属性
link.label.text = '123'; 的简写就是:link.text = '123';
如果link.text为null, link.label 对象也为null.
Returns
string
Inherited from
Link.text
set
text(v
): void
Parameters
Name | Type |
---|---|
v | string |
Returns
void
Inherited from
Link.text
top
get
top(): number
Since
2.4.0
Returns
number
Inherited from
Link.top
set
top(v
): void
Parameters
Name | Type |
---|---|
v | number |
Returns
void
Inherited from
Link.top
userData
get
userData(): any
Deprecated
已过时,请使用更简短的:data 属性替代
Returns
any
Inherited from
Link.userData
set
userData(v
): void
Deprecated
已过时,请使用更简短的:data 属性替代
Parameters
Name | Type |
---|---|
v | any |
Returns
void
Inherited from
Link.userData
visible
get
visible(): boolean
Returns
boolean
Inherited from
Link.visible
set
visible(v
): void
Parameters
Name | Type |
---|---|
v | boolean |
Returns
void
Inherited from
Link.visible
width
get
width(): number
Returns
number
Inherited from
Link.width
set
width(v
): void
Parameters
Name | Type |
---|---|
v | number |
Returns
void
Inherited from
Link.width
x
get
x(): number
Returns
number
Inherited from
Link.x
set
x(v
): void
Parameters
Name | Type |
---|---|
v | number |
Returns
void
Inherited from
Link.x
y
get
y(): number
Returns
number
Inherited from
Link.y
set
y(v
): void
Parameters
Name | Type |
---|---|
v | number |
Returns
void
Inherited from
Link.y
zIndex
get
zIndex(): number
Returns
number
Inherited from
Link.zIndex
set
zIndex(v
): void
Parameters
Name | Type |
---|---|
v | number |
Returns
void
Inherited from
Link.zIndex
Methods
addChild
addChild(child
): FoldLink
增加子对象
Parameters
Name | Type |
---|---|
child | DisplayObject |
Returns
Inherited from
addChilds
addChilds(childs
): void
一次性增加多个对象, 比单个增加速度快多,数量越多越明显!
但是:互为子节点、重复添加的情形需要开发者来确保避免。
Parameters
Name | Type |
---|---|
childs | DisplayObject [] |
Returns
void
Inherited from
addClass
addClass(styleName
): void
增加一个样式
obj.addClass('.focus');
Parameters
Name | Type |
---|---|
styleName | string |
Returns
void
Inherited from
addEventListener
addEventListener(type
, callback
): void
增加事件监听
Parameters
Name | Type | Description |
---|---|---|
type | string | 事件类型 |
callback | Function |
Returns
void
Inherited from
attr
attr(attr
): void
已过时,即将删除
Deprecated
Parameters
Name | Type |
---|---|
attr | any |
Returns
void
Inherited from
changeParent
changeParent(newParent
): FoldLink
修改父对象但保持屏幕坐标不变
Parameters
Name | Type |
---|---|
newParent | DisplayObject |
Returns
Inherited from
clearCss
clearCss(): void
清除通过css或setStyles定义的所有样式
Returns
void
Inherited from
css
css(styleOption
, value?
): FoldLink
背景和边框的设置语法参考css样式, 图形绘制的语法使用cavnas属性设置,如下:
node.css({
border: 'solid 1px gray',
borderRadius: 5,
font: 'bold 11px arial',
color: 'gray',
textPosition: 'center',
textAlign: 'center',
textBaseline: 'middle',
});
Parameters
Name | Type |
---|---|
styleOption | string | StyleOptions |
value? | any |
Returns
Inherited from
destory
destory(): void
销毁,释放相关的资源引用,一旦销毁,对象不能再被访问,访问就会报错。
注意:销毁后,所有事件回调、动画、定时器等均不能再访问,否则会报错。
Returns
void
Inherited from
dispatchEvent
dispatchEvent(event
): void
分发事件
Parameters
Name | Type |
---|---|
event | any |
Returns
void
Inherited from
draw
draw(ctx
): FoldLink
绘制
Parameters
Name | Type |
---|---|
ctx | CanvasRenderingContext2D |
Returns
Inherited from
drawPoints
drawPoints(ctx
): void
已过时,请使用 drawShape 来替代
Deprecated
Parameters
Name | Type |
---|---|
ctx | CanvasRenderingContext2D |
Returns
void
Inherited from
getAABB
getAABB(recursive?
): Rectangle
获取对象在Layer中的aabb包围盒
Parameters
Name | Type | Description |
---|---|---|
recursive? | boolean | 是否将子节点包含在内 |
Returns
Inherited from
getAllLinks
getAllLinks(): DisplayObject
[]
递归式 获取所有连线对象
Returns
所有连线对象
Inherited from
getAllNodes
getAllNodes(): DisplayObject
[]
递归式 获取所有节点对象
Returns
所有节点对象
Inherited from
getBeginArrow
getBeginArrow(): Node
获取开始箭头对象
Returns
Inherited from
getBeginPoint
getBeginPoint(): PointLike
获取连线的开始点坐标
Returns
Inherited from
getChildren
getChildren(): DisplayObject
[]
获取所有子对象
Returns
Inherited from
getComputedStyle
getComputedStyle(obj
): Style
获取指定对象样式层叠计算后的样式(只读,不要修改返回的对象)
Parameters
Name | Type |
---|---|
obj | DisplayObject |
Returns
Inherited from
getEndArrow
getEndArrow(): Node
获取结束箭头对象
Returns
Inherited from
getEndPoint
getEndPoint(): PointLike
获取连线的结束点坐标
Returns
Inherited from
getLabel
getLabel(): Node
Returns
Inherited from
getLinks
getLinks(): Link
[]
获取所有连接到本对象的Link
Returns
Link
[]
Inherited from
getLocalPoint
getLocalPoint(t
, segIndex?
): PointLike
获取对象边框或者线上某一点(本地坐标系)
Parameters
Name | Type |
---|---|
t | number |
segIndex? | number |
Returns
Inherited from
getPoint
getPoint(t
, segIndex?
): PointLike
获取对象上某一点
Parameters
Name | Type | Description |
---|---|---|
t | number | [0-1] 在线段上的比例 |
segIndex? | number | 线段索引(Node是矩形,有4条线段,索引:[0-3])可选项 |
Returns
Inherited from
getPoints
getPoints(): PointLike
[]
Returns
Inherited from
getPositionNames
getPositionNames(): string
[]
获取本对象上定义的所有位置名称
Returns
string
[]
Inherited from
getRoot
getRoot(): FoldLink
获取'root'对象, 沿着parent一直向上追溯
Returns
Inherited from
getSegmentPoints
getSegmentPoints(): PointLike
[]
Returns
Inherited from
getStageTransform
getStageTransform(): any
Returns
any
Inherited from
getStyle
getStyle(name
): any
读取某个样式的值
Parameters
Name | Type |
---|---|
name | string |
Returns
any
Inherited from
getTransform
getTransform(): Transform
Override
Returns
Inherited from
getUserData
getUserData(): any
读取用户自定义的数据
Returns
any
Inherited from
getWorldTransform
getWorldTransform(): any
Returns
any
Inherited from
hasChild
hasChild(child
): boolean
是否拥有子对象
Parameters
Name | Type |
---|---|
child | DisplayObject |
Returns
boolean
Inherited from
hasChildren
hasChildren(): boolean
Returns
boolean
Inherited from
hasClass
hasClass(styleName
): boolean
检测是否拥有某个样式类
node.hasClass('.focus');
Since
2.4.0
Parameters
Name | Type |
---|---|
styleName | string |
Returns
boolean
Inherited from
hasListener
hasListener(type
): boolean
是否有该类型的监听
Parameters
Name | Type |
---|---|
type | string |
Returns
boolean
Inherited from
hide
hide(): FoldLink
隐藏
Returns
Inherited from
hideAllChild
hideAllChild(): void
隐藏所有下级节点
Returns
void
Inherited from
isAlone
isAlone(): boolean
Returns
boolean
Inherited from
isConnected
isConnected(): boolean
是否被任意Link连接到
Since
2.4.0
Returns
boolean
Inherited from
isOutOfParent
isOutOfParent(): boolean
是否超出了父节点的矩形区域
Returns
boolean
Inherited from
isVisible
isVisible(): boolean
判断是否可见
Returns
boolean
Inherited from
nearest
nearest(x
, y
): Intersect
| { x
: number
= x; y
: number
= y }
Parameters
Name | Type |
---|---|
x | number |
y | number |
Returns
Intersect
| { x
: number
= x; y
: number
= y }
Inherited from
on
on(type
, callback
): void
增加监听事件, 功能完全等同于addEventListener,一种简写
Parameters
Name | Type | Description |
---|---|---|
type | string | 事件类型 |
callback | Function | 事件处理函数 |
Returns
void
Inherited from
pickable
pickable(): boolean
是否可被拾取到,默认返回:mouseEnabled 属性
pickable() {
return this.mouseEnabled;
}
Returns
boolean
Inherited from
querySelector
querySelector(querySelector
): DisplayObject
功能类似querySelectorAll,但只返回第一个满足条件的对象或者null
Parameters
Name | Type |
---|---|
querySelector | string | Function |
Returns
Inherited from
querySelectorAll
querySelectorAll(querySelector?
): DisplayObject
[]
对象选择器
语法兼容DOM的Selector API标准(并不支持标准里的所有语法)
支持的语法形式如下:
//obj.querySelector(类名称), 例如:
let circleNodes = layer.querySelectorAll('CircleNode');
let links = layer.querySelector('Link');
//obj.querySelector(样式名称),例如:
let serverNodes = layer.querySelectorAll('.server');
let activedObjs = layer.querySelectorAll('.active');
let arr = layer.querySelectorAll((e)=>e.x > 20 && e.y < 100);
//obj.querySelector(ID);
let obj = layer.querySelectorAll('#123')[0];
//obj.querySelector([属性名称=""]);
let arr = layer.querySelectorAll('[text="abc"]');
let arr2 = layer.querySelectorAll('[draggable=true]');
// obj.querySelector(类名称|样式名称[属性名称=""]);
let obj = layer.querySelector('TextNode[x<=-200]');
let obj2 = layer.querySelector('.server[text="X86"]');
Parameters
Name | Type |
---|---|
querySelector? | string | Function |
Returns
Inherited from
remove
remove(): FoldLink
removeFromParent的简写。
推荐使用语义更明确的:removeFromParent()来替代。
Returns
Inherited from
removeAllChild
removeAllChild(): FoldLink
移除所有子对象
Returns
Inherited from
removeAllClass
removeAllClass(): void
移除所有通过addClass添加的样式
obj.removeAllClass();
Returns
void
Inherited from
removeChild
removeChild(child
): FoldLink
移除一个子对象
Parameters
Name | Type |
---|---|
child | DisplayObject |
Returns
Inherited from
removeChilds
removeChilds(childs
): FoldLink
移除多个子对象
Parameters
Name | Type |
---|---|
childs | DisplayObject [] |
Returns
Inherited from
removeClass
removeClass(styleName
): void
移除一个样式
obj.removeClass('.focus');
Parameters
Name | Type |
---|---|
styleName | string |
Returns
void
Inherited from
removeEventListener
removeEventListener(type
, callback
): any
移除一个事件监听
Parameters
Name | Type |
---|---|
type | string |
callback | Function |
Returns
any
Inherited from
removeFromParent
removeFromParent(): FoldLink
从父容器中移除
Returns
Inherited from
removeUserData
removeUserData(): FoldLink
移除用户自定义的数据
Deprecated
已过时,直接设置 data 为空对象或者null 即可
Returns
Inherited from
screenToLocalVec
screenToLocalVec(vec
): Vec2
将一个屏幕坐标系下的向量转换到本地坐标系 @@since 2.5.0
Parameters
Name | Type |
---|---|
vec | Vec2 |
Returns
Inherited from
screenToLocalXY
screenToLocalXY(x
, y
): any
将一个屏幕坐标转换到本地坐标系
Parameters
Name | Type |
---|---|
x | number |
y | number |
Returns
any
Inherited from
setBegin
setBegin(target
, positionName?
): void
设置连线的开始点
Parameters
Name | Type | Description |
---|---|---|
target | LinkTarget | 开始连接点对象,可以是Node、Link,也可以是一个简单的点, 甚至是一个函数,函数返回的对象必须有x、y属性。当时 |
positionName? | string |
Returns
void
Inherited from
setBeginArrow
setBeginArrow(node
): FoldLink
设置开始端的箭头
Parameters
Name | Type |
---|---|
node | Node |
Returns
Inherited from
setBeginOffset
setBeginOffset(n
): void
设置开始端的偏移量
Parameters
Name | Type |
---|---|
n | number |
Returns
void
Inherited from
setEnd
setEnd(target
, positionName?
): void
设置连线的结束点
Parameters
Name | Type | Description |
---|---|---|
target | LinkTarget | 连接对象,可以是Node、Link,也可以是一个简单的点,甚至是一个函数,函数返回的对象必须有x、y属性。 |
positionName? | string | 端点 |
Returns
void
Inherited from
setEndArrow
setEndArrow(node
): FoldLink
设置结束端的箭头
Parameters
Name | Type |
---|---|
node | Node |
Returns
Inherited from
setEndOffset
setEndOffset(n
): void
设置结束端的偏移量
Parameters
Name | Type |
---|---|
n | number |
Returns
void
Inherited from
setLabel
setLabel(textOrNode
): Node
| FoldLink
设置文本标签
Parameters
Name | Type | Description |
---|---|---|
textOrNode | string | Node | 文字或者Node对象 |
Returns
Inherited from
setStyles
setStyles(styleOpt
, value?
): FoldLink
完全等价于css 方法
Parameters
Name | Type |
---|---|
styleOpt | StyleOptions |
value? | any |
Returns
Inherited from
setUserData
setUserData(data
): FoldLink
设置用户自定义数据
直接在节点对象上增加属性不是稳妥的方法,若要向节点增加额外的属性,应该调用此方法
Deprecated
已过时,直接访问 data 即可
Parameters
Name | Type |
---|---|
data | any |
Returns
Inherited from
setZIndex
setZIndex(index
): void
设置zIndex
Parameters
Name | Type |
---|---|
index | number |
Returns
void
Inherited from
setzIndex
setzIndex(index
): void
请使用 setZIndex(Z大写)
Deprecated
Parameters
Name | Type |
---|---|
index | number |
Returns
void
Inherited from
show
show(): FoldLink
显示
Returns
Inherited from
showAllChild
showAllChild(): void
显示所有下级节点
Returns
void
Inherited from
stageToLocalVec
stageToLocalVec(vec
): Vec2
Deprecated
v2.5.0 后使用 screenToLocalVec 替代
Parameters
Name | Type |
---|---|
vec | Vec2 |
Returns
Inherited from
stageToLocalXY
stageToLocalXY(x
, y
): any
Deprecated
v2.5.0 后使用 screenToLocalXY 替代
Parameters
Name | Type |
---|---|
x | number |
y | number |
Returns
any
Inherited from
toJSON
toJSON(indexInfo?
): SerializedDisplayObject
Parameters
Name | Type |
---|---|
indexInfo? | ObjectIndexInfo |
Returns
Inherited from
toLayerXY
toLayerXY(x
, y
): PointLike
Deprecated
v2.5.0 后使用 toWorldXY 替代
Parameters
Name | Type |
---|---|
x | number |
y | number |
Returns
Inherited from
toScreenXY
toScreenXY(x
, y
): any
将一个本地坐标转到屏幕(实际是canvas)坐标系
cavnas的左上角为0,0
Since
2.5.0
Parameters
Name | Type |
---|---|
x | number |
y | number |
Returns
any
Inherited from
toStageXY
toStageXY(x
, y
): any
Deprecated
v2.5.0 后使用 toSreenXY 替代
Parameters
Name | Type |
---|---|
x | number |
y | number |
Returns
any
Inherited from
toWorldXY
toWorldXY(x
, y
): PointLike
将一个本地坐标转到世界坐标系
Since
2.5.0
Parameters
Name | Type |
---|---|
x | number |
y | number |
Returns
Inherited from
transformPoint
transformPoint(p
): Object
Parameters
Name | Type |
---|---|
p | PointLike |
Returns
Object
Name | Type |
---|---|
x | number |
y | number |
Inherited from
translateWith
translateWith(dx
, dy
): FoldLink
增量式平移
Parameters
Name | Type |
---|---|
dx | number |
dy | number |
Returns
Inherited from
unlink
unlink(): void
断开开始和
Returns
void
Inherited from
unlinkBegin
unlinkBegin(): void
Returns
void
Inherited from
unlinkEnd
unlinkEnd(): void
Returns
void
Inherited from
updatePoints
updatePoints(): any
[]
Returns
any
[]
Overrides
updateZIndex
updateZIndex(): void
Returns
void
Inherited from
updatezIndex
updatezIndex(): void
请使用 upateZIndex(Z大写)
Deprecated
Returns
void
Inherited from
upgradeParent
upgradeParent(): any
Returns
any
Inherited from
flatten
Static
flatten(arr
, cond?
, breadthFirst?
): DisplayObject
[]
Parameters
Name | Type |
---|---|
arr | DisplayObject [] |
cond? | Function |
breadthFirst? | boolean |
Returns
Inherited from
getNoChildrensObjects
Static
getNoChildrensObjects(arr
): DisplayObject
[]
Parameters
Name | Type |
---|---|
arr | DisplayObject [] |