Class fabric.Group
Extends
fabric.Object.
Group
Defined in: group.class.js.
| Constructor Attributes | Constructor Name and Description |
|---|---|
| Field Attributes | Field Name and Description |
|---|---|
|
Executes given function for each object in this group
|
|
- Fields borrowed from class fabric.Object:
- FX_DURATION, FX_TRANSITION, includeDefaultValues, MIN_SCALE_LIMIT, NUM_FRACTION_DIGITS, rotate, selectable, stateProperties
| Method Attributes | Method Name and Description |
|---|---|
|
Activates (makes active) all group objects
|
|
|
add(object)
Adds an object to a group; Then recalculates group's dimension, position.
|
|
|
Returns complexity of an instance
|
|
|
contains(object)
Returns true if a group contains an object
|
|
|
containsPoint(point)
Checks if point is contained within the group
|
|
|
destroy()
Destroys a group (restoring state of its objects)
|
|
| <static> |
fabric.Group.fromObject(object, options)
Returns fabric.Group instance from an object representation
|
|
Returns an array of all objects in this group
|
|
|
hasMoved()
Checks whether this group was moved (since `saveCoords` was called last)
|
|
|
initialize(objects, options)
Constructor
|
|
|
item(index)
Returns object from the group at the specified index
|
|
|
remove(object)
Removes an object from a group; Then recalculates group's dimension, position.
|
|
|
render(ctx)
Renders instance on a given context
|
|
|
Saves coordinates of this instance (to be used together with `hasMoved`)
|
|
|
set(name, value)
Sets property to a given value
|
|
|
setActive(value)
Activates (makes active) all group objects
|
|
|
Sets coordinates of all group objects
|
|
|
size()
Returns a size of a group (i.e: length of an array containing its objects)
|
|
|
Makes all of this group's objects grayscale (i.e.
|
|
|
toObject()
Returns object representation of an instance
|
|
|
toString()
Returns string represenation of a group
|
- Methods borrowed from class fabric.Object:
- callSuper, clone, cloneAsImage, drawBorders, drawCorners, fxRemove, fxStraighten, get, getAngle, getCenter, getHeight, getWidth, hasStateChanged, intersectsWithObject, intersectsWithRect, isActive, isContainedWithinRect, isType, saveState, scale, scaleToHeight, scaleToWidth, setAngle, setCoords, setGradientFill, setOpacity, setOptions, setSourcePath, setupState, straighten, toDatalessObject, toDataURL, toggle, toJSON, transform
Field Detail
{fabric.Group}
forEachObject
Executes given function for each object in this group
{String}
type
Method Detail
{fabric.Group}
activateAllObjects()
Activates (makes active) all group objects
- Returns:
- {fabric.Group} thisArg
{fabric.Group}
add(object)
Adds an object to a group; Then recalculates group's dimension, position.
- Parameters:
- {Object} object
- Returns:
- {fabric.Group} thisArg
{Number}
complexity()
Returns complexity of an instance
- Returns:
- {Number} complexity
{Boolean}
contains(object)
Returns true if a group contains an object
- Parameters:
- {Object} object
- Object to check against
- Returns:
- {Boolean} `true` if group contains an object
{Boolean}
containsPoint(point)
Checks if point is contained within the group
- Parameters:
- {fabric.Point} point
- point with `x` and `y` properties
- Returns:
- {Boolean} true if point is contained within group
{fabric.Group}
destroy()
Destroys a group (restoring state of its objects)
- Returns:
- {fabric.Group} thisArg
<static>
{fabric.Group}
fabric.Group.fromObject(object, options)
Returns fabric.Group instance from an object representation
- Parameters:
- object
- {Object} object to create a group from
- options
- {Object} options object
- Returns:
- {fabric.Group} an instance of fabric.Group
{Array}
getObjects()
Returns an array of all objects in this group
- Returns:
- {Array} group objects
{Boolean}
hasMoved()
Checks whether this group was moved (since `saveCoords` was called last)
- Returns:
- {Boolean} true if an object was moved (since fabric.Group#saveCoords was called)
{Object}
initialize(objects, options)
Constructor
- Parameters:
- {Object} objects
- Group objects
- {Object} options Optional
- Options object
- Returns:
- {Object} thisArg
{fabric.Object}
item(index)
Returns object from the group at the specified index
- Parameters:
- index
- {Number} index of item to get
- Returns:
- {fabric.Object}
{fabric.Group}
remove(object)
Removes an object from a group; Then recalculates group's dimension, position.
- Parameters:
- {Object} object
- Returns:
- {fabric.Group} thisArg
render(ctx)
Renders instance on a given context
- Parameters:
- {CanvasRenderingContext2D} ctx
- context to render instance on
{fabric.Group}
saveCoords()
Saves coordinates of this instance (to be used together with `hasMoved`)
- Returns:
- {fabric.Group} thisArg
{fabric.Group}
set(name, value)
Sets property to a given value
- Returns:
- {fabric.Group} thisArg
{fabric.Group}
setActive(value)
Activates (makes active) all group objects
- Parameters:
- {Boolean} value
- `true` to activate object, `false` otherwise
- Returns:
- {fabric.Group} thisArg
{fabric.Group}
setObjectsCoords()
Sets coordinates of all group objects
- Returns:
- {fabric.Group} thisArg
{Number}
size()
Returns a size of a group (i.e: length of an array containing its objects)
- Returns:
- {Number} Group size
toGrayscale()
Makes all of this group's objects grayscale (i.e. calling `toGrayscale` on them)
{Object}
toObject()
Returns object representation of an instance
- Returns:
- {Object} object representation of an instance
{String}
toString()
Returns string represenation of a group
- Returns:
- {String}