Class Index | File Index

Classes


Class fabric.Group


Extends fabric.Object.
Group
Defined in: group.class.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Field Summary
Field Attributes Field Name and Description
 
Fields borrowed from class fabric.Object:
FX_DURATION, FX_TRANSITION, includeDefaultValues, MIN_SCALE_LIMIT, NUM_FRACTION_DIGITS, options, rotate, stateProperties
Method Summary
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
 
 
Destroys a group (restoring state of its objects)
 
forEachObject(callback, context)
<static>  
fabric.Group.fromObject(object, options)
 
Returns an array of all objects in this group
 
 
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
 
 
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)
 
 
Returns object representation of an instance
 
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, setOpacity, setOptions, setSourcePath, straighten, toDatalessObject, toDataURL, toggle, toJSON, transform
Class Detail
fabric.Group()
Field Detail
{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)
Parameters:
{Object} 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

{fabric.Group} forEachObject(callback, context)
Parameters:
{Function} callback
Callback invoked with current object as first argument, index - as second and an array of all objects - as third. Iteration happens in reverse order (for performance reasons). Callback is invoked in a context of Global Object (e.g. `window`) when no `context` argument is given
{Object} context
Context (aka thisObject)
Returns:
{fabric.Group} thisArg

<static> {fabric.Group} fabric.Group.fromObject(object, options)
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()
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()
Returns:
{fabric.Group} thisArg

{fabric.Group} set(name, value)
Sets property to a given value
Parameters:
{String} name
{Object|Function} 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()

{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}

Documentation generated by JsDoc Toolkit 2.4.0 on Thu Oct 14 2010 21:41:43 GMT-0400 (EDT)