doodle.createGraphics
Description:
- Graphics (draw:Array) :Object
-
Inherits
- Object
Parameters
- draw:Array –
Returns
- Object –
Properties
- lineCap :string
-
Returns
- string – [read-only]
See Also
- context.lineCap [Canvas API]
- A lineCap Example [Canvas Tutorial]
- lineJoin :string
-
Returns
- string – [read-only]
See Also
- context.lineJoin [Canvas API]
- A lineJoin Example [Canvas Tutorial]
- lineWidth :number
-
Returns
- number – [read-only]
See Also
- context.lineWidth [Canvas API]
- A lineWidth Example [Canvas Tutorial]
- 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
- context.miterLimit [Canvas API]
- A miterLimit Demo [Canvas Tutorial]
Methods
- bezierCurveTo (pt1:Point, pt2:Point, pt3:Point) :void
-
Bezier curve to point.
Parameters
- pt1:Point – Control point 1
- pt2:Point – Control point 2
- pt3:Point – End point
See Also
- context.bezierCurveTo [Canvas API]
- Bezier and Quadratic Curves [Canvas Tutorial]
- beginGradientFill (type:GradientType, pt1:Point, pt2:Point, ratios:Array, colors:Array, alphas:Array) :void
-
Parameters
- type:GradientType –
- pt1:Point –
- pt2:Point –
- ratios:Array – Array of numbers.
- colors:Array –
- alphas:Array –
See Also
- context.createLinearGradient [Canvas API]
- context.createRadialGradient [Canvas API]
- context.addColorStop [Canvas API]
- context.fillStyle [Canvas API]
- Gradients [Canvas Tutorial]
- beginPath () :void
-
See Also
- context.beginPath [Canvas API]
- Drawing Paths [Canvas Tutorial]
- beginPatternFill (image:HTMLImageElement, repeat:Pattern) :void
-
Parameters
- image:HTMLImageElement –
- repeat:Pattern –
See Also
- context.createPattern [Canvas API]
- context.fillStyle [Canvas API]
- Patterns [Canvas Tutorial]
- circle (x:number, y:number, radius:number) :void
-
Parameters
- x:number – The x location of the center of the circle relative to the registration point of the parent display object (in pixels).
- y:number – The y location of the center of the circle relative to the registration point of the parent display object (in pixels).
- radius:number –
See Also
- Arcs [Canvas Tutorial]
- closePath () :void
-
See Also
- context.closePath [Canvas API]
- context.stroke [Canvas API]
- Drawing Paths [Canvas Tutorial]
- ellipse (x:number, y:number, width:number, height:number) :void
-
Parameters
- x:number –
- y:number –
- width:number –
- height:number –
- endFill () :void
-
See Also
- context.fill [Canvas API]
- Drawing Paths [Canvas Tutorial]
- lineStyle (thickness:number, color:Color, alpha:number, caps:LineCap, joints:LineJoin, miterLimit:number) :void
-
Parameters
- thickness:number –
- color:Color –
- alpha:number –
- caps:LineCap –
- joints:LineJoin –
- miterLimit:number –
See Also
- context.lineWidth [Canvas API]
- context.strokeStyle [Canvas API]
- context.lineCap [Canvas API]
- context.lineJoin [Canvas API]
- context.miterLimit [Canvas API]
- lineTo (x:number, y:number) :void
- moveTo (x:number, y:number) :void
- rect (x:number, y:number, width:number, height:number) :void
-
Parameters
- x:number –
- y:number –
- width:number –
- height:number –
See Also
- context.rect [Canvas API]
- Rectangles [Canvas Tutorial]
- roundRect (x:number, y:number, width:number, height:number, rx:number, ry:number) :void
-
Parameters
- x:number –
- y:number –
- width:number –
- height:number –
- rx:number –
- ry:number –
- stroke () :void
-
See Also
- context.stroke [Canvas API]
- Drawing Paths [Canvas Tutorial]
- 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
- 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
- pt1:Point – Control point
- pt2:Point – End point
See Also
- context.quadraticCurveTo [Canvas API]
- Bezier and Quadratic Curves [Canvas Tutorial]
- clear () :void
-
Remove all drawing commands for sprite.
- toString () :string
-
Returns the string representation of the specified object.
- beginFill (color:Color, alpha:number) :void
-
Specifies a simple one-color fill that subsequent calls to other graphics methods use when drawing.
Parameters
- color:Color – In hex format.
- alpha:number –
See Also
- context.fillStyle [Canvas API]
- Colors [Canvas Tutorial]