在线工具
网站地图    收藏    合作   
<

快捷菜单 返回顶部

fabric.js中文API

fabric.js中文在线API,fabric.js中文文档API大全

Namespace: Collection

fabric.Collection

Source:

Methods

(static) add(…object) → {Self}

将对象添加到集合、画布或组中,然后渲染画布 (如果' renderOnAddRemove '不是' false ')。 在Group的情况下,不改变边界框。 对象应该是fabric的实例(或从fabric继承)。对象 非常不建议群组使用此功能。 你可以用add方法添加一堆对象,但是你需要 为Group类或position/bbox运行addWithUpdate调用将是错误的。
Parameters:
Name Type Attributes Description
object fabric.Object <repeatable>
零个或多个fabric实例
Source:
Returns:
thisArg
Type
Self

(static) complexity() → {Number}

返回集合复杂度的数字表示形式
Source:
Returns:
complexity
Type
Number

(static) contains(object, deepopt) → {Boolean}

如果集合包含对象则返回true
Parameters:
Name Type Attributes Default Description
object Object 核对对象
deep Boolean <optional>
false ' true '检查所有子类,' false '只检查' _objects '
Source:
Returns:
`true` if collection contains an object
Type
Boolean

(static) forEachObject(callback, context) → {Self}

对该组中的每个对象执行给定的函数
Parameters:
Name Type Description
callback function 以当前对象作为第一个参数调用的回调, 索引——作为第二,所有对象的数组——作为第三。 在全局对象的上下文中调用回调(Callback)。“窗口”) 当没有给出' context '参数时
context Object 背景(又名thisObject)
Source:
Returns:
thisArg
Type
Self

(static) getObjects(typeopt) → {Array}

返回此实例的子对象数组 1.3.10中引入的类型参数 自2.3.5起,此方法总是返回数组的COPY;
Parameters:
Name Type Attributes Description
type String <optional>
当指定时,只返回此类型的对象
Source:
Returns:
Type
Array

(static) insertAt(object, index, nonSplicing) → {Self}

将对象插入到指定索引的集合中,然后渲染画布(如果' renderOnAddRemove '不是' false ') 对象应该是fabric的实例(或从fabric继承)。对象 非常不建议群组使用此功能。 你可以用insertAt方法添加一堆对象,然后你需要 为Group类或position/bbox运行addWithUpdate调用将是错误的。
Parameters:
Name Type Description
object Object 插入的对象
index Number 插入对象的索引
nonSplicing Boolean 当为true时,不会发生对象的拼接(移位)
Source:
Returns:
thisArg
Type
Self

(static) isEmpty() → {Boolean}

如果集合中不包含任何对象,则返回true
Source:
Returns:
true if collection is empty
Type
Boolean

(static) item(index) → {Self}

返回指定索引处的对象
Parameters:
Name Type Description
index Number
Source:
Returns:
thisArg
Type
Self

(static) remove(…object) → {Self}

从集合中移除对象,然后渲染画布(如果' renderOnAddRemove '不是' false ')
Parameters:
Name Type Attributes Description
object fabric.Object <repeatable>
零个或多个fabric实例
Source:
Returns:
thisArg
Type
Self

(static) size() → {Number}

返回集合的大小(即:包含其对象的数组的长度)
Source:
Returns:
Collection size
Type
Number

自学PHP网专注网站建设学习,PHP程序学习,平面设计学习,以及操作系统学习

京ICP备14009008号@版权所有www.zixuephp.com

网站声明:本站所有视频,教程都由网友上传,站长收集和分享给大家学习使用,如由牵扯版权问题请联系站长邮箱904561283@qq.com