Class Index | File Index

Classes


Class fabric.Object

Object
Defined in: object.class.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Field Summary
Field Attributes Field Name and Description
<constant>  
<constant>  
 
<constant>  
<constant>  
 
 
 
 
Method Summary
Method Attributes Method Name and Description
 
callSuper(methodName)
 
clone(options)
Clones an instance
 
cloneAsImage(callback)
Creates an instance of fabric.Image out of an object
 
 
Draws borders of an object's bounding box.
 
Draws corners of an object's bounding box.
 
fxRemove(callbacks)
 
fxStraighten(callbacks)
 
get(property)
Basic getter
 
Returns object's angle value
 
 
Returns height of an object
 
Returns width of an object
 
 
initialize(options)
Constructor
 
Returns true if object intersects with another object
 
intersectsWithRect(selectionTL, selectionBR)
Returns true if object intersects with an area formed by 2 points
 
Returns true if an object is in its active state
 
isContainedWithinRect(selectionTL, selectionBR)
Returns true if object is fully contained within area formed by 2 points
 
isType(type)
 
render(ctx, noTransform)
 
 
scale(value)
Scales an object (equally by x and y)
 
Scales an object to a given height (scaling by x/y equally)
 
scaleToWidth(value)
Scales an object to a given width (scaling by x/y equally)
 
set(property, value)
Basic setter
 
setActive(active)
Sets state of an object - `true` makes it active, `false` - inactive
 
setAngle(value)
Sets object's angle
 
Sets corner position coordinates based on current angle, width and height.
 
setOpacity(value)
Sets object opacity
 
setOptions(options)
 
 
 
 
Converts an object into a data-url-like string
 
toggle(property)
Toggles specified property from `true` to `false` or from `false` to `true`
 
Makes object's color grayscale
 
Returns a JSON representation of an instance
 
Returns an object representation of an instance
 
Returns a string representation of an instance
 
transform(ctx)
Class Detail
fabric.Object()
Field Detail
<constant> {Number} FX_DURATION

<constant> {String} FX_TRANSITION

{Boolean} includeDefaultValues

<constant> {Number} MIN_SCALE_LIMIT

<constant> {Number} NUM_FRACTION_DIGITS

{Object} options

rotate

{Array} stateProperties

{String} type
Method Detail
callSuper(methodName)
Parameters:
{String} methodName

{fabric.Object} clone(options)
Clones an instance
Parameters:
{Object} options
object
Returns:
{fabric.Object} clone of an instance

{fabric.Object} cloneAsImage(callback)
Creates an instance of fabric.Image out of an object
Parameters:
callback
{Function} callback, invoked with an instance as a first argument
Returns:
{fabric.Object} thisArg

{Number} complexity()
Returns:
{Number}

{fabric.Object} drawBorders(ctx)
Draws borders of an object's bounding box. Requires public properties: width, height Requires public options: padding, borderColor
Parameters:
{CanvasRenderingContext2D} ctx
Context to draw on
Returns:
{fabric.Object} thisArg

{fabric.Object} drawCorners(ctx)
Draws corners of an object's bounding box. Requires public properties: width, height, scaleX, scaleY Requires public options: cornersize, padding
Parameters:
{CanvasRenderingContext2D} ctx
Context to draw on
Returns:
{fabric.Object} thisArg

{fabric.Object} fxRemove(callbacks)
Parameters:
{Object} callbacks
Returns:
{fabric.Object} thisArg

{fabric.Object} fxStraighten(callbacks)
Parameters:
{Object} callbacks
- onComplete: invoked on completion - onChange: invoked on every step of animation
Returns:
{fabric.Object} thisArg

{Any} get(property)
Basic getter
Parameters:
{Any} property
Returns:
{Any} value of a property

{Number} getAngle()
Returns object's angle value
Returns:
{Number} angle value

{Object} getCenter()
Returns:
{Object} object with `x`, `y` properties corresponding to path center coordinates

{Number} getHeight()
Returns height of an object
Returns:
{Number} height value

{Number} getWidth()
Returns width of an object
Returns:
{Number} width value

{Boolean} hasStateChanged()
Returns:
{Boolean} true if instance' state has changed

initialize(options)
Constructor
Parameters:
{Object} options Optional
Options object

{Boolean} intersectsWithObject(other)
Returns true if object intersects with another object
Parameters:
{Object} other
Object to test
Returns:
{Boolean}

{Boolean} intersectsWithRect(selectionTL, selectionBR)
Returns true if object intersects with an area formed by 2 points
Parameters:
{Object} selectionTL
{Object} selectionBR
Returns:
{Boolean}

{Boolean} isActive()
Returns true if an object is in its active state
Returns:
{Boolean} true if an object is in its active state

{Boolean} isContainedWithinRect(selectionTL, selectionBR)
Returns true if object is fully contained within area formed by 2 points
Parameters:
{Object} selectionTL
{Object} selectionBR
Returns:
{Boolean}

{Boolean} isType(type)
Parameters:
type
{String} type to check against
Returns:
{Boolean} true if specified type is identical to the type of instance

render(ctx, noTransform)
Parameters:
{CanvasRenderingContext2D} ctx
context to render on
{Boolean} noTransform

{fabric.Object} saveState()
Returns:
{fabric.Object} thisArg

{fabric.Object} scale(value)
Scales an object (equally by x and y)
Parameters:
value
{Number} scale factor
Returns:
{fabric.Object} thisArg

{fabric.Object} scaleToHeight(value)
Scales an object to a given height (scaling by x/y equally)
Parameters:
value
{Number} new height value
Returns:
{fabric.Object} thisArg

{fabric.Object} scaleToWidth(value)
Scales an object to a given width (scaling by x/y equally)
Parameters:
value
{Number} new width value
Returns:
{fabric.Object} thisArg

{fabric.Object} set(property, value)
Basic setter
Parameters:
{Any} property
{Any} value
Returns:
{fabric.Object} thisArg

{fabric.Object} setActive(active)
Sets state of an object - `true` makes it active, `false` - inactive
Parameters:
{Boolean} active
Returns:
{fabric.Object} thisArg

{Object} setAngle(value)
Sets object's angle
Parameters:
value
{Number} angle value
Returns:
{Object} thisArg

setCoords()
Sets corner position coordinates based on current angle, width and height.

{fabric.Object} setOpacity(value)
Sets object opacity
Parameters:
value
{Number} value 0-1
Returns:
{fabric.Object} thisArg

setOptions(options)
Parameters:
{Object} options Optional

{fabric.Object} setSourcePath(value)
Parameters:
{String} value
Returns:
{fabric.Object} thisArg

{fabric.Object} straighten()
Returns:
{fabric.Object} thisArg

toDatalessObject()

{String} toDataURL()
Converts an object into a data-url-like string
Returns:
{String} string of data

{fabric.Object} toggle(property)
Toggles specified property from `true` to `false` or from `false` to `true`
Parameters:
{String} property
property to toggle
Returns:
{fabric.Object} thisArg

{fabric.Object} toGrayscale()
Makes object's color grayscale
Returns:
{fabric.Object} thisArg

{String} toJSON()
Returns a JSON representation of an instance
Returns:
{String} json

{Object} toObject()
Returns an object representation of an instance
Returns:
{Object}

{String} toString()
Returns a string representation of an instance
Returns:
{String}

transform(ctx)
Parameters:
{CanvasRenderingContext2D} ctx
Context

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