API Docs for: 0.0.2
Show:

canvas.Element Class

Extends ludo.Core
Module: calendar

Base class for Canvas elements. canvas.Element can be handled as canvas.Node, but it extends ludo.Core which make it accessible using ludo.get('id'). The canvas.Node object can be accessed using getNode. A canvas.Element object can be adopted to other elements or nodes using the adopt or adopt methods. A canvas element contains methods for transformations and other

Item Index

Properties

Attributes

Methods

adopt

(
  • node
)
canvas.Element

Adopt element or node

Parameters:

Returns:

canvas.Element: parent

empty

() canvas.Element

Remove text and child nodes from element

Returns:

flyBack

(
  • el
  • duration
)

Animates back to translate(0,0)

Parameters:

get

(
  • key
)
String

Returns value of an attribute

Parameters:

Returns:

String: value

Example:

var element = new ludo.canvas.Element('rect', {
    attr:{x1:100,y1:150,x2:200,y2:250}
});
alert(element.get('x1')); // outputs 100

getNode

() canvas.Node

Return canvas node for this element

Returns:

canvas.Node: node

Properties

node

canvas.Node

Reference to canvas.Node

Attributes

attr

Object

Attributes applied to DOM node

Default: undefined

Example:

{
        x1:50,y1:50,x2:100,y2:150
    }

p

Object

Properties

tag

String

Which tag, example: "rect"