02.06.2013 Views

jQuery 1.4 Animation Techniques - Index of

jQuery 1.4 Animation Techniques - Index of

jQuery 1.4 Animation Techniques - Index of

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Method Usage<br />

fill() Colors in the shape created by the current path.<br />

[ 269 ]<br />

Chapter 10<br />

lineTo(a, b) Creates a new sub-path from the current location to the<br />

coordinates specified as arguments.<br />

moveTo(a, b) Moves to the coordinates specified by the arguments<br />

without drawing a new sub-path.<br />

quadraticCurveTo(a, b, c, d) Draws a sub-path along a quadratic curve, which is a<br />

curve with a single control point. Arguments a and b<br />

represent the coordinates <strong>of</strong> the control point, while<br />

arguments c and d represent the end coordinates <strong>of</strong> the<br />

sub-path.<br />

stroke() Colors in the outline <strong>of</strong> the current path list.<br />

Paths have several properties that can be set including the style <strong>of</strong> the end <strong>of</strong> the line, or<br />

cap, or how paths are joined:<br />

Property Usage<br />

lineCap Can be set to either butt (the default), round, or square.<br />

lineJoin Can be set to either miter (the default), round, or bevel.<br />

lineWidth A decimal specifying the width <strong>of</strong> the path.<br />

miterLimit Determines the length between the inner point where two paths<br />

connect and the outer point before the join is mitered.<br />

Images and patterns<br />

The canvas allows us to draw images to the canvas in the same way that we might assign<br />

a background image to another element. We can also draw patterns based on images or<br />

gradients. This category <strong>of</strong> methods includes:<br />

Method Usage<br />

drawImage(a, b, c) Draws an image on the . Argument<br />

a is the image to draw and arguments b and<br />

c are the coordinates to place the top-left<br />

point <strong>of</strong> the image. Note that other variants<br />

<strong>of</strong> this method exist which allow different<br />

combinations <strong>of</strong> arguments allowing images to<br />

be scaled and sliced.<br />

createPattern(a, b) Draws a repeated pattern on the .<br />

Argument a is the image to use as the pattern,<br />

b is the type <strong>of</strong> repeat.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!