Canvas Nasal API: Difference between revisions

Jump to navigation Jump to search
Filled in some methods of Path
(Filled in what I could about the Text element)
(Filled in some methods of Path)
Line 265: Line 265:
Inherits from element.
Inherits from element.


=== reset ===
A path is similar to drawing with a pen on paper. The move and moveTo methods represent lifting the pen from the paper and moving to a new position. The drawing methods like lineTo would then be seen as starting from the current position of the pen. Therefore offcause the order the methods is called in, is important.
=== setData ===
=== setDataGeo ===
=== addSegment ===
=== moveTo ===
=== moveTo ===
'''Parameters:''' (x, y)
Moves the position to an new absolute position.
=== move ===
=== move ===
'''Parameters:''' (x, y)
Moves the position to an new relative position from the current.
=== reset ===
'''Parameters:''' ()
Remove all existing path data.
=== lineTo ===
=== lineTo ===
'''Parameters:''' (x, y)
Draws a line to specified position.
=== line ===
=== line ===
'''Parameters:''' (x, y)
Draws a line to specified relative position.
=== horizTo ===
=== horizTo ===
'''Parameters:''' (x)
Draws a horizontal line to specified position.
=== horiz ===
=== horiz ===
'''Parameters:''' (x)
Draws a horizontal line to specified relative position.
=== vertTo ===
=== vertTo ===
'''Parameters:''' (y)
Draws a vertical line to specified position.
=== vert ===
=== vert ===
'''Parameters:''' (y)
Draws a vertical line to specified relative position.
=== quadTo ===
=== quadTo ===
'''Parameters:''' (x, y)
Draws quadratic Bézier curve.
=== quad ===
=== quad ===
'''Parameters:''' (x, y)
Draws quadratic Bézier curve. Relative coordinates.
=== cubicTo ===
=== cubicTo ===
'''Parameters:''' (x, y)
Draws cubic Bézier curve.
=== cubic ===
=== cubic ===
=== quadTo ===
'''Parameters:''' (x, y)
=== quad ===
 
Draws cubic Bézier curve. Relative coordinates.
=== scubicTo ===
=== scubicTo ===
=== scubic ===
=== scubic ===
Line 295: Line 330:
=== close ===
=== close ===
=== setColor ===
=== setColor ===
'''Parameters:''' (r, g, b)
'''Parameters:''' (r, g, b, a)
Sets the color of the drawn path
=== setColorFill ===
=== setColorFill ===
=== setFill ===
'''Parameters:''' (r, g, b)
=== setStroke ===
 
'''Parameters:''' (r, g, b, a)
 
Calling this will make the path get filled in the specified color. For example if you draw a 'V' and fill it, the fill area will be a triangle inside the 'V'.
=== setStrokeLineWidth ===
=== setStrokeLineWidth ===
'''Parameters:''' (width)
The width of the path.
=== setStrokeLineCap ===
=== setStrokeLineCap ===
'''Parameters:''' (type)
Caps the path. Type can be "butt", "round" or "square".
=== setStrokeDashArray ===
=== setStrokeDashArray ===
'''Parameters:''' (pattern)
Make dashed path. Pattern is a vector of alternating dash and gap lengths. ? horizontal, or misunderstood the vector ?
Example: my_path.setStrokeDashArray([10, 20, 10, 20, 10]);
=== setData ===
=== setDataGeo ===
=== addSegment ===
== Map ==
== Map ==
Inherits from element.
Inherits from element.
579

edits

Navigation menu