doodle.createGraphics

Description:

Graphics (draw:Array) :Object

Inherits

  1. Object

Parameters

  1. draw:Array –

Returns

  • Object –

Properties

lineCap :string

Returns

  • string – [read-only]

See Also

lineJoin :string

Returns

  • string – [read-only]

See Also

lineWidth :number

Returns

  • number – [read-only]

See Also

lineMiter :number

The miter value means that a second filled triangle must (if possible, given the miter length) be rendered at the join, with one line being the line between the two aforementioned corners, abutting the first triangle, and the other two being continuations of the outside edges of the two joining lines, as long as required to intersect without going over the miter length.

Returns

  • number – [read-only]

See Also

Methods

bezierCurveTo (pt1:Point, pt2:Point, pt3:Point) :void

Bezier curve to point.

Parameters

  1. pt1:Point – Control point 1
  2. pt2:Point – Control point 2
  3. pt3:Point – End point

See Also

beginGradientFill (type:GradientType, pt1:Point, pt2:Point, ratios:Array, colors:Array, alphas:Array) :void

Parameters

  1. type:GradientType –
  2. pt1:Point –
  3. pt2:Point –
  4. ratios:Array – Array of numbers.
  5. colors:Array –
  6. alphas:Array –

See Also

beginPath () :void

See Also

beginPatternFill (image:HTMLImageElement, repeat:Pattern) :void

Parameters

  1. image:HTMLImageElement –
  2. repeat:Pattern –

See Also

circle (x:number, y:number, radius:number) :void

Parameters

  1. x:number – The x location of the center of the circle relative to the registration point of the parent display object (in pixels).
  2. y:number – The y location of the center of the circle relative to the registration point of the parent display object (in pixels).
  3. radius:number –

See Also

  • Arcs [Canvas Tutorial]
closePath () :void

See Also

ellipse (x:number, y:number, width:number, height:number) :void

Parameters

  1. x:number –
  2. y:number –
  3. width:number –
  4. height:number –
endFill () :void

See Also

lineStyle (thickness:number, color:Color, alpha:number, caps:LineCap, joints:LineJoin, miterLimit:number) :void

Parameters

  1. thickness:number –
  2. color:Color –
  3. alpha:number –
  4. caps:LineCap –
  5. joints:LineJoin –
  6. miterLimit:number –

See Also

lineTo (x:number, y:number) :void

Parameters

  1. x:number –
  2. y:number –

See Also

moveTo (x:number, y:number) :void

Parameters

  1. x:number –
  2. y:number –

See Also

rect (x:number, y:number, width:number, height:number) :void

Parameters

  1. x:number –
  2. y:number –
  3. width:number –
  4. height:number –

See Also

roundRect (x:number, y:number, width:number, height:number, rx:number, ry:number) :void

Parameters

  1. x:number –
  2. y:number –
  3. width:number –
  4. height:number –
  5. rx:number –
  6. ry:number –
stroke () :void

See Also

draw (fn:Function) :void

Provide direct access to the canvas drawing api. Canvas context is called as the first argument to function. Unable to set bounds from a user supplied function unless explictly set.

Parameters

  1. fn:Function –

Examples

  • x = Object.create(doodle.sprite);
    x.graphics.draw(function (ctx) {
      ctx.fillStyle = "#ff0000";
      ctx.fillRect(this.x, this.y, 100, 100);
    });
    x.draw();
curveTo (pt1:Point, pt2:Point) :void

Quadratic curve to point.

Parameters

  1. pt1:Point – Control point
  2. pt2:Point – End point

See Also

clear () :void

Remove all drawing commands for sprite.

toString () :string

Returns the string representation of the specified object.

Returns

  • string –

See Also

beginFill (color:Color, alpha:number) :void

Specifies a simple one-color fill that subsequent calls to other graphics methods use when drawing.

Parameters

  1. color:Color – In hex format.
  2. alpha:number –

See Also