<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<?xml-stylesheet href="_c74_vig.xsl" type="text/xsl"?>
<vignette name="The Sketch Object" package="Max">
<h1>
The Sketch Object
</h1>
<p>
Every instance of <o>jsui</o> has an instance of Sketch bound to the variable "sketch". This is often the only instance of Sketch you will need to use. However, if you want to do things like render sprites, have multiple layers of images, or use drawing commands to create alpha channels for images, then you can create additional instances to render in. By default, when any function in your <o>jsui</o> object has been called the context is already set for the instance of Sketch bound to the variable "sketch".
</p>
<h2>
Sketch Constructor
</h2>
<code language="javascript">
var mysketch = new Sketch(); // create a new instance of Sketch with default width and height
var mysketch = new Sketch(width,height); // create a new instance of sketch with specified width and height
</code>

	<jsproperties_list name="Sketch">
		<jsproperty name="size" get="1" set="1" type="Array[2]">
			<description>
				size[0] is width size[1] is height.
        	</description>
    	</jsproperty>

		<jsproperty name="fsaa" get="1" set="1" type="Boolean">
			<description>
				Turns on/off full scene antialiasing.
        	</description>
    	</jsproperty>
    </jsproperties_list>

<jsmethod_list name="Sketch Simple Line and Polygon">
  		<jsmethod name="move">
		    <arglist>
		    	<arg name="delta_x" type="Number"/>
		    	<arg name="delta_y" type="Number"/>
		    	<arg name="delta_z" type="Number"/>
		    </arglist>
		    <description>
		    	Moves the drawing position to the location specified by the sum of the current drawing position and the delta <i>x</i>, <i>y</i>, and <i>z</i> arguments.
		    </description>
  		</jsmethod>

  		<jsmethod name="moveto">
		    <arglist>
		    	<arg name="x" type="Number"/>
		    	<arg name="y" type="Number"/>
		    	<arg name="z" type="Number"/>
		    </arglist>
		    <description>
		    	Moves the drawing position to the location specified by the <i>x</i>, <i>y</i>, and <i>z</i> arguments.
		    </description>
  		</jsmethod>

  		<jsmethod name="point">
		    <arglist>
		    	<arg name="x" type="Number"/>
		    	<arg name="y" type="Number"/>
		    	<arg name="z" type="Number"/>
		    </arglist>
		    <description>
		    	Draws a point at the location specified by the <i>x</i>, <i>y</i>, and <i>z</i> arguments. After this method has been called, the drawing position is updated to the location specified by the <i>x</i>, <i>y</i>, and <i>z</i> arguments.
		    </description>
  		</jsmethod>


  		<jsmethod name="line">
		    <arglist>
		    	<arg name="delta_x" type="Number"/>
		    	<arg name="delta_y" type="Number"/>
		    	<arg name="delta_z" type="Number"/>
		    </arglist>
		    <description>
		    	Draws a line from the current drawing position to the location specified the sum of the current drawing position and the delta <i>x</i>, <i>y</i>, and <i>z</i> arguments. After this method has been called, the drawing position is updated to the location specified by the sum of the current drawing position and the delta <i>x</i>, <i>y</i>, and <i>z</i> arguments.
		    </description>
  		</jsmethod>

  		<jsmethod name="lineto">
		    <arglist>
		    	<arg name="x" type="Number"/>
		    	<arg name="y" type="Number"/>
		    	<arg name="z" type="Number"/>
		    </arglist>
		    <description>
		    	Draws a line from the current drawing position to the location specified by the <i>x</i>, <i>y</i>, and <i>z</i> arguments. After this method has been called, the drawing position is updated to the location specified by the <i>x</i>, <i>y</i>, and <i>z</i> arguments.
		    </description>
  		</jsmethod>


  		<jsmethod name="linesegment">
		    <arglist>
		    	<arg name="x1" type="Number"/>
		    	<arg name="y1" type="Number"/>
		    	<arg name="z1" type="Number"/>
		    	<arg name="x2" type="Number"/>
		    	<arg name="y2" type="Number"/>
		    	<arg name="z2" type="Number"/>
		    </arglist>
		    <description>
		    	Draws a line from the location specified by the <i>x1</i>, <i>y1</i>, and <i>z1</i>  arguments to the location specified by the <i>x2</i>, <i>y2</i>, and <i>z2</i>  arguments. After this method has been called, the drawing position is updated to the location specified by the <i>x2</i>, <i>y2</i>, and <i>z2</i>  arguments.
		    </description>
  		</jsmethod>

  		<jsmethod name="tri">
		    <arglist>
		    	<arg name="x1" type="Number"/>
		    	<arg name="y1" type="Number"/>
		    	<arg name="z1" type="Number"/>
		    	<arg name="x2" type="Number"/>
		    	<arg name="y2" type="Number"/>
		    	<arg name="z2" type="Number"/>
		    	<arg name="x3" type="Number"/>
		    	<arg name="y3" type="Number"/>
		    	<arg name="z3" type="Number"/>
		    </arglist>
		    <description>
		    	Draws a filled triangle with three corners specified by the <i>x1</i>, <i>y1</i>, <i>z1</i>, <i>x2</i>, <i>y2</i>, <i>z2</i>, <i>x3</i>, <i>y3</i>, and <i>z3</i>  arguments. After this method has been called, the drawing position is updated to the location specified by the <i>x3</i>, <i>y3</i>, and <i>z3</i>  arguments.
		    </description>
  		</jsmethod>


  		<jsmethod name="frametri">
		    <arglist>
		    	<arg name="x1" type="Number"/>
		    	<arg name="y1" type="Number"/>
		    	<arg name="z1" type="Number"/>
		    	<arg name="x2" type="Number"/>
		    	<arg name="y2" type="Number"/>
		    	<arg name="z2" type="Number"/>
		    	<arg name="x3" type="Number"/>
		    	<arg name="y3" type="Number"/>
		    	<arg name="z3" type="Number"/>
		    </arglist>
		    <description>
		    	Draws a framed triangle with three corners specified by the <i>x1</i>, <i>y1</i>, <i>z1</i>, <i>x2</i>, <i>y2</i>, <i>z2</i>, <i>x3</i>, <i>y3</i>, and <i>z3</i>  arguments. After this method has been called, the drawing position is updated to the location specified by the <i>x3</i>, <i>y3</i>, and <i>z3</i>  arguments.
		    </description>
  		</jsmethod>


  		<jsmethod name="quad">
		    <arglist>
		    	<arg name="x1" type="Number"/>
		    	<arg name="y1" type="Number"/>
		    	<arg name="z1" type="Number"/>
		    	<arg name="x2" type="Number"/>
		    	<arg name="y2" type="Number"/>
		    	<arg name="z2" type="Number"/>
		    	<arg name="x3" type="Number"/>
		    	<arg name="y3" type="Number"/>
		    	<arg name="z3" type="Number"/>
		    	<arg name="x4" type="Number"/>
		    	<arg name="y4" type="Number"/>
		    	<arg name="z4" type="Number"/>
		    </arglist>
		    <description>
		    	Draws a filled quadrilateral with four corners specified by the <i>x1</i>, <i>y1</i>, <i>z1</i>, <i>x2</i>, <i>y2</i>, <i>z2</i>, <i>x3</i>, <i>y3</i>, <i>z3</i>, <i>x4</i>, <i>y4</i>, and <i>z4</i>  arguments. After this method has been called, the drawing position is updated to the location specified by the <i>x4</i>, <i>y4</i>, and <i>z4</i>  arguments.
		    </description>
  		</jsmethod>

  		<jsmethod name="framequad">
		    <arglist>
		    	<arg name="x1" type="Number"/>
		    	<arg name="y1" type="Number"/>
		    	<arg name="z1" type="Number"/>
		    	<arg name="x2" type="Number"/>
		    	<arg name="y2" type="Number"/>
		    	<arg name="z2" type="Number"/>
		    	<arg name="x3" type="Number"/>
		    	<arg name="y3" type="Number"/>
		    	<arg name="z3" type="Number"/>
		    	<arg name="x4" type="Number"/>
		    	<arg name="y4" type="Number"/>
		    	<arg name="z4" type="Number"/>
		    </arglist>
		    <description>
		    	Draws a framed quadrilateral with four corners specified by the <i>x1</i>, <i>y1</i>, <i>z1</i>, <i>x2</i>, <i>y2</i>, <i>z2</i>, <i>x3</i>, <i>y3</i>, <i>z3</i>, <i>x4</i>, <i>y4</i>, and <i>z4</i>  arguments. After this method has been called, the drawing position is updated to the location specified by the <i>x4</i>, <i>y4</i>, and <i>z4</i>  arguments.
		    </description>
  		</jsmethod>
	</jsmethod_list>

	<jsmethod_list name="Shape">
  		<jsmethod name="circle">
		    <arglist>
		    	<arg name="radius" type="Number"/>
		    	<arg name="theta_start" type="Number"/>
		    	<arg name="theta_end" type="Number"/>
		    </arglist>
		    <description>
		    	Draws a filled circle with radius specified by the radius argument. If theta_start and theta_end are specified, then an arc will be drawn instead of a full circle. The theta_start and theta_end arguments are in terms of degrees(0-360). The current shapeorient, shapeslice, and shapeprim values will also affect the drawing.
		    </description>
  		</jsmethod>

  		<jsmethod name="cube">
		    <arglist>
		    	<arg name="scale_x" type="Number"/>
		    	<arg name="scale_y" type="Number"/>
		    	<arg name="scale_z" type="Number"/>
		    </arglist>
		    <description>
		    	Draws a cube with width 2*scale_x, height 2*scale_y, depth 2*scale_z, and center point at the current drawing position. If the scale_y and scale_z arguments are not specified, they will assume the same value as scale_x. The current shapeorient, shapeslice, and shapeprim values will also affect the drawing.
		    </description>
  		</jsmethod>


  		<jsmethod name="cylinder">
		    <arglist>
		    	<arg name="radius1" type="Number"/>
		    	<arg name="radius2" type="Number"/>
		    	<arg name="mag" type="Number"/>
		    	<arg name="theta_start" type="Number"/>
		    	<arg name="theta_end" type="Number"/>
		    </arglist>
		    <description>
		    	Draws a cylinder with top radius specified by the radius1 argument, bottom radius specified by the radius2 argument, length specified by the mag argument, and center point at the current drawing position. If the theta_start and theta_end arguments are specified, then a patch will be drawn instead of a full cylinder. The theta_start and theta_end arguments are in terms of degrees(0-360). The current shapeorient, shapeslice, and shapeprim values will also affect the drawing.
		    </description>
  		</jsmethod>

  		<jsmethod name="ellipse">
		    <arglist>
		    	<arg name="radius1" type="Number"/>
		    	<arg name="radius2" type="Number"/>
		    	<arg name="theta_start" type="Number"/>
		    	<arg name="theta_end" type="Number"/>
		    </arglist>
		    <description>
		    	Draws a filled ellipse with radii specified by the radius1 and radius2 arguments. If theta_start and theta_end are specified, then an arc will be drawn instead of a full ellipse. The theta_start and theta_end arguments are in terms of degrees(0-360). The current shapeorient, shapeslice, and shapeprim values will also affect the drawing.
		    </description>
  		</jsmethod>

  		<jsmethod name="framecircle">
		    <arglist>
		    	<arg name="radius" type="Number"/>
		    	<arg name="theta_start" type="Number"/>
		    	<arg name="theta_end" type="Number"/>
		    </arglist>
		    <description>
		    	Draws a framed circle with radius specified by the radius argument. If theta_start and theta_end are specified, then an arc will be drawn instead of a full circle. The theta_start and theta_end arguments are in terms of degrees(0-360). The current shapeorient, shapeslice, and shapeprim values will also affect the drawing.
		    </description>
  		</jsmethod>

  		<jsmethod name="frameellipse">
		    <arglist>
		    	<arg name="radius1" type="Number"/>
		    	<arg name="radius2" type="Number"/>
		    	<arg name="theta_start" type="Number"/>
		    	<arg name="theta_end" type="Number"/>
		    </arglist>
		    <description>
		    	Draws a framed ellipse with radii specified by the radius1 and radius2 arguments. If theta_start and theta_end are specified, then an arc will be drawn instead of a full ellipse. The theta_start and theta_end arguments are in terms of degrees(0-360). The current shapeorient, shapeslice, and shapeprim values will also affect the drawing.
		    </description>
  		</jsmethod>


  		<jsmethod name="plane">
		    <arglist>
		    	<arg name="scale_x1" type="Number"/>
		    	<arg name="scale_y1" type="Number"/>
		    	<arg name="scale_x2" type="Number"/>
		    	<arg name="scale_y2" type="Number"/>
		    </arglist>
		    <description>
		    	Draws a plane with top width 2*scale_x1, left height 2*scale_y1, bottom width 2*scale_x2, right height 2*scale_y2, and center point at the current drawing position. If scale_y1 is not specified, it will assume the same value as scale_x1. If scale_x2 and scale_y2 are not specified, they will assume the same values as scale_x1 and scale_y1 respectively. The current shapeorient, shapeslice, and shapeprim values will also affect the drawing.
		    </description>
  		</jsmethod>


  		<jsmethod name="roundedplane">
		    <arglist>
		    	<arg name="round_amount" type="Number"/>
		    	<arg name="scale_x" type="Number"/>
		    	<arg name="scale_y" type="Number"/>
		    </arglist>
		    <description>
		    	Draws a rounded plane with width 2*scale_x, and height 2*scale_y and center point at the current drawing position. The size of the rounded portion of the plane is determined by the round_amount argument. If scale_y is not specified, it will assume the same value as scale_x. The current shapeorient, shapeslice, and shapeprim values will also affect the drawing.
		    </description>
  		</jsmethod>


  		<jsmethod name="sphere">
  			<arglist>
		    	<arg name="radius" type="Number"/>
		    	<arg name="theta1_start" type="Number"/>
		    	<arg name="theta1_end" type="Number"/>
		    	<arg name="theta2_start" type="Number"/>
		    	<arg name="theta2_end" type="Number"/>
		    </arglist>
		    <description>
		    	Draws a sphere with radius specified by the radius argument and center point at the current drawing position. If the theta1_start, theta1_end, theta2_start, and theta2_end arguments are specified, then a patch will be drawn instead of a full sphere. The theta1_start, theta1_end, theta2_start, and theta2_end arguments are in terms of degrees(0-360). The current shapeorient, shapeslice, and shapeprim values will also affect the drawing.
		    </description>
  		</jsmethod>


  		<jsmethod name="torus">
  			<arglist>
		    	<arg name="radius1" type="Number"/>
		    	<arg name="radius2" type="Number"/>
		    	<arg name="theta1_start" type="Number"/>
		    	<arg name="theta1_end" type="Number"/>
		    	<arg name="theta2_start" type="Number"/>
		    	<arg name="theta2_end" type="Number"/>
		    </arglist>
		    <description>
		    	Draws a torus with major radius specified by the radius1 argument, minor radius specified by the radius2 argument, and center point at the current drawing position. If theta1_start, theta1_end, theta2_start, and theta2_end are specified, then a patch will be drawn instead of a full torus. The theta1_start, theta1_end, theta2_start, and theta2_end arguments are in terms of degrees(0-360). The current shapeorient, shapeslice, and shapeprim values will also affect the drawing.
		    </description>
  		</jsmethod>
  	</jsmethod_list>


	<jsmethod_list name="Sketch Shape Attribute">
  		<jsmethod name="shapeorient">
		    <arglist>
		    	<arg name="rotation_x" type="Number"/>
		    	<arg name="rotation_y" type="Number"/>
		    	<arg name="rotation_z" type="Number"/>
		    </arglist>
		    <description>
		    	Sets the rotation for drawing internal to any of the "shape" drawing methods to the rotation specified by the x_rot, y_rot, and rotation_x, rotation_y, and rotation_z arguments. Its use internal to a given shape method such as torus(0.1) would essentially be equivalent to the following set of OpenGL calls.

		    	<code language="javascript">
					with (sketch) {
					    glmatrixmode("modelview");
					    glpushmatrix();
					    glrotate(rotation_x,1.,0.,0.);
					    glrotate(rotation_y,1.,1.,0.);
					    glrotate(rotation_z,0.,0.,1.);
					    torus(0.5,0.2);
					    glpopmatrix();
					}
				</code>
		    </description>
  		</jsmethod>

  		<jsmethod name="shapeslice">
		    <arglist>
		    	<arg name="slice_a, slice_b" type="Number"/>
		    	<arg name="slice_b" type="Number"/>
		    </arglist>
		    <description>
		    	Sets the number of slices to use when rendering any of the "shape" drawing methods. Increasing the slice_a and slice_b arguments will increase the quality at which the shape is rendered, while decreasing these values will improve performance.
		    </description>
  		</jsmethod>


  		<jsmethod name="shapeprim">
		    <arglist>
		    	<arg name="draw_prim" type="String"/>
		    </arglist>
		    <description>
		    	Sets the OpenGL drawing primitive to use within any of the "shape" drawing methods. Acceptable values for the draw_prim argument are the following strings: lines, line_loop, line_strip, points, polygon, quads, quad_grid, quad_strip, triangles, tri_grid, tri_fan, tri_strip.
		    </description>
  		</jsmethod>
  	</jsmethod_list>


	<jsmethod_list name="Sketch Text">
  		<jsmethod name="font">
		    <arglist>
		    	<arg name="fontname" type="String"/>
		    </arglist>
		    <description>
		    	Sets the current font to the fontname specified by the fontname argument.
		    </description>
  		</jsmethod>

  		<jsmethod name="fontsize">
		    <arglist>
		    	<arg name="points" type="Number"/>
		    </arglist>
		    <description>
		    	Sets the fontsize to the size specified by the points argument. Note that this size is an absolute, rather than relative value.
		    </description>
  		</jsmethod>

  		<jsmethod name="gettextinfo">
		    <arglist>
		    	<arg name="string" type="String"/>
		    </arglist>
		    <description>
		    	Returns an array containing the width and height of the given string in absolute screen coordinates, taking into account the current font and fontsize.
		    </description>
  		</jsmethod>

  		<jsmethod name="text">
		    <arglist>
		    	<arg name="string" type="String"/>
		    </arglist>
		    <description>
		    	Draws the text specified by the string argument at the current drawing position, taking into account the current font, fontsize, and text alignment. Text is strictly 2D, and does not take into account any world transformations. After calling the text method, if the x axis text alignment is set to "left", the current drawing position will be updated to reflect the world position associated with the end of the string. If the x axis text alignment is set to "right", the current drawing position will be updated to reflect the world position associated with the end of the string. If the x axis text alignment is set to "center", the current drawing position will remain unchanged.
		    </description>
  		</jsmethod>

  		<jsmethod name="textalign">
		    <arglist>
		    	<arg name="align_x" type="String"/>
		    	<arg name="align_y" type="String"/>
		    </arglist>
		    <description>
		    	Sets the alignment of text to be drawn with respect to the current drawing position. Acceptable values for the x axis alignment are: "left", "right", or "center". Acceptable values for the y axis alignment are: "bottom", "top", or "center". The default alignment is "left", "bottom".
		    </description>
  		</jsmethod>
  	</jsmethod_list>

	<jsmethod_list name="Sketch Pixel Methods">
  		<jsmethod name="copypixels">
		    <arglist>
		    	<arg name="source_object" type="String"/>
		    	<arg name="destination_x" type="Number"/>
		    	<arg name="destination_y" type="Number"/>
		    	<arg name="source_x" type="Number"/>
		    	<arg name="source_y" type="Number"/>
		    	<arg name="width" type="Number"/>
		    	<arg name="height" type="Number"/>
		    </arglist>
		    <description>
		    	Copies pixels from the source object to the location specified by the destination_x and destination_y arguments. The initial <i>x</i> and <i>y</i> offset into the source and size of the rectangle copied can be speified by the source_x, source_y, width and height arguments. If these are not present an <i>x</i> and <i>y</i> offset of zero and width and height equal to the source image is assumed. No scaling of pixels is supported. The source object can either be an instance of Image, or Sketch. If blending is enabled in the destination sketch object, alpha blending will be performed and the current alpha color will also be applied globally. The copypixels method is much faster than obtaining the equivalent result using glbindtexture() to texture a plane, and is the recommended means of drawing images when scaling and rotation is not required.
		    </description>
  		</jsmethod>


  		<jsmethod name="depthatpixel">
		    <arglist>
		    	<arg name="x" type="Number"/>
		    	<arg name="y" type="Number"/>
		    </arglist>
		    <description>
		    	Returns the depth value associated with the currently rendered pixel at a given absolute screen coordinate.
		    </description>
  		</jsmethod>

  		<jsmethod name="freepeer">
		    <description>
		    	Frees the image data from the native c peer, which is not considered by the JavaScript garbage collector, and may consume lots of memory until the garbage collector decides to run based on JS allocated memory. Once called, the Sketch object is not available for any other use.
		    </description>
  		</jsmethod>

  		<jsmethod name="getpixel">
  			<arglist>
		    	<arg name="x" type="Number"/>
		    	<arg name="y" type="Number"/>
		    </arglist>
		    <description>
		    	Returns an array containing the pixel value at the specified location. This array is ordered RGBA, i.e. array element 0 is red, 1, green, 2, blue, 3 alpha. Color values are floating point numbers in the range 0.-1.
		    </description>
  		</jsmethod>

  		<jsmethod name="setpixel">
		    <arglist>
		    	<arg name="x" type="Number"/>
		    	<arg name="y" type="Number"/>
		    	<arg name="red" type="Number"/>
		    	<arg name="green" type="Number"/>
		    	<arg name="blue" type="Number"/>
		    	<arg name="alpha" type="Number"/>
		    </arglist>
		    <description>
		    	Sets the pixel value at the specified location. Color values are floating point numbers in the range 0.-1.
		    </description>
  		</jsmethod>

  		<jsmethod name="screentoworld">
  			<arglist>
		    	<arg name="x" type="Number"/>
		    	<arg name="y" type="Number"/>
		    </arglist>
		    <description>
		    	Returns an array containing the <i>x</i>, <i>y</i>, and <i>z</i> world coordinates associated with a given screen pixel using the same the depth from the camera as 0,0,0. Optionally a third depth arg may be specified, which may be useful for hit detection and other applications. The depth value is typically specified in the range 0.-1. where 0 is the near clipping plane, and 1. is the far clipping plane. The worldtoscreen method can be used to determine the depth value of a given world coordinate, and the depthatpixel method can be used to determine the depth value associated with the currently rendered pixel at a given absolute screen coordinate.
		    </description>
  		</jsmethod>

  		<jsmethod name="worldtoscreen">
  			<arglist>
		    	<arg name="x" type="Number"/>
		    	<arg name="y" type="Number"/>
		    	<arg name="z" type="Number"/>
		    </arglist>
		    <description>
		    	Returns an array containing the x, y, and depth screen coordinates associated with a given world coordinate. The depth value is typically specified in the range 0.-1. where 0 is the near clipping plane, and 1. is the far clipping plane.
		    </description>
  		</jsmethod>
  	</jsmethod_list>

	<jsmethod_list name="Sketch Stroke">
  		<jsmethod name="beginstroke">
		    <arglist>
		    	<arg name="stroke_style" type="String"/>
		    </arglist>
		    <description>
		    	Begin definition of a stroked path of the style specified by the stroke_style argument. Currently supported stroke styles are "basic2d" and "line".
		    </description>
  		</jsmethod>

  		<jsmethod name="endstroke">
		    <description>
		    	End definition of a stroked path, and render the path.
		    </description>
  		</jsmethod>

  		<jsmethod name="strokeparam">
		    <arglist>
		    	<arg name="parameter_name" type="String"/>
		    	<arg name="parameter_values" type="Anything"/>
		    	<arg name="arguments" type="Anything"/>
		    </arglist>
		    <description>
		    	Set the current value of the parameter specified by the parameter_name argument to be the value specified by parameter_values argument(s). Some parameters are global for the extent of a stroked path definition, while others may vary on a point by point basis.
		    </description>
  		</jsmethod>

  		<jsmethod name="strokepoint">
  			<arglist>
		    	<arg name="x" type="Number"/>
		    	<arg name="y" type="Number"/>
		    	<arg name="z" type="Number"/>
		    </arglist>
		    <description>
		    	Defines an anchor point at the location specified by the <i>x</i>, <i>y</i>, and <i>z</i> arguments. Some stroke styles such as "basic2d" will ignore the z coordinate.
		    </description>
  		</jsmethod>
    </jsmethod_list>

<h2>
Basic 2D Stroke Style Parameters
</h2>
<code>
  alpha
</code>
<p>
May vary point to point. Value is specified as an alpha value. Useful if alpha is the only color channel which will vary throughout the path.
</p>
<code>
  color
</code>
<p>
May vary point to point. Values are specified as red, green, blue, and alpha values.
</p>
<code>
  order
</code>
<p>
global. Value is specified as interpolation order. The default order is 3, or bi-cubic interpolation.
</p>
<code>
  outline
</code>
<p>
global. Value is specified as on/off (0/1). The default is 1.
</p>
<code>
  outcolor
</code>
<p>
May vary point to point. Values are specified as red, green, blue, and alpha values. If no outcolor has been specified, then the current color is assumed.
</p>
<code>
  scale
</code>
<p>
May vary point to point. Value is specified as an width value. This value controls how wide the stroked path is.
</p>
<code>
  slices
</code>
<p>
global. Value is specified as number of slices per curve section. The default is 20.
</p>
<h2>
Line Stroke Style Parameters
</h2>
<code>
  alpha
</code>
<p>
May vary point to point. Value is specified as an alpha value. Useful if alpha is the only color channel which will vary throughout the path.
</p>
<code>
  color
</code>
<p>
May vary point to point. Values are specified as red, green, blue, and alpha values.
</p>
<code>
  order
</code>
<p>
global. Value is specified as interpolation order. The default order is 3, or bi-cubic interpolation.
</p>
<code>
  slices
</code>
<p>
global. Value is specified as number of slices per curve section. The default is 20.
</p>
	<jsmethod_list name="Sketch Setup">
  		<jsmethod name="default2d">
		    <description>
		    	The default2d method is a simple way to set the graphics state to default properties useful for 2D graphics. It is called everytime your object is resized if default2d() has been called more recently than default3d(). It is essentially equivalent to the following set of calls:
		    	<code language="javascript">
				  with (sketch) {
				    glpolygonmode("front_and_back","fill");
				    glpointsize(1.);
				    gllinewidth(1.);
				    gldisable("depth_test");
				    gldisable("fog");
				    glcolor(0.,0.,0.,1.);
				    glshademodel("smooth");
				    gldisable("lighting");
				    gldisable("normalize");
				    gldisable("texture");
				    glmatrixmode("projection");
				    glloadidentity();
				    glortho(-aspect, aspect, -1, 1, -1,100.);
				    glmatrixmode("modelview");
				    glloadidentity();
				    glulookat(0.,0.,2.,0.,0.,0.,0.,0.,1.);
				    glclearcolor(1., 1., 1., 1.);
				    glclear();
				    glenable("blend");
				    glblendfunc("src_alpha","one_minus_src_alpha");
				  }
				</code>
		    </description>
  		</jsmethod>

  		<jsmethod name="default3d">
		    <description>
		    	The default3d method is a simple way to set the graphics state to default properties useful for 3D graphics. It is called everytime the <o>jsui</o> object is resized if default3d() has been called more recently than default2d().
		    	<p>
				It is essentially equivalent to the following set of calls:
				</p>
				<code language="javascript">
				  with (sketch) {
				    glpolygonmode("front_and_back","fill");
				    glpointsize(1.);
				    gllinewidth(1.);
				    glenable("depth_test");
				    glenable("fog");
				    glcolor(0.,0.,0.,1.);
				    glshademodel("smooth");
				    gllightmodel("two_side", "true");
				    glenable("lighting");
				    glenable("light0");
				    glenable("normalize");
				    gldisable("texture");
				    glmatrixmode("projection");
				    glloadidentity();
				    gluperspective(default_lens_angle, aspect, 0.1, 100.);
				    glmatrixmode("modelview");
				    glloadidentity();
				    glulookat(0.,0.,2.,0.,0.,0.,0.,0.,1.);
				    glclearcolor(1., 1., 1., 1.);
				    glclear();
				    glenable("blend");
				    glblendfunc("src_alpha","one_minus_src_alpha");
				  }
				</code>
		    </description>
  		</jsmethod>

  		<jsmethod name="ortho3d">
		    <arglist>
		    	<arg name="" type=""/>
		    </arglist>
		    <description>
		    	The orth3d method is a simple way to set the graphics state to default properties useful for 3D graphics, using an orthographic projection (i.e. object scale is not affected by distance from the camera). It is called every time the <o>jsui</o> object is resized if ortho3d() has been called more recently than default2d(), or default3d().

		    	<p>
				It is essentially equivalent to the following set of calls:
				</p>
				<code language="javascript">
				  with (sketch) {
				    glpolygonmode("front_and_back","fill");
				    glpointsize(1.);
				    gllinewidth(1.);
				    glenable("depth_test");
				    glenable("fog");
				    glcolor(0.,0.,0.,1.);
				    glshademodel("smooth");
				    gllightmodel("two_side", "true");
				    glenable("lighting");
				    glenable("light0");
				    glenable("normalize");
				    gldisable("texture");
				    glmatrixmode("projection");
				    glloadidentity();
				    glortho(-aspect, aspect, -1, 1, -1,100.);
				    glmatrixmode("modelview");
				    glloadidentity();
				    glulookat(0.,0.,2.,0.,0.,0.,0.,0.,1.);
				    glclearcolor(1., 1., 1., 1.);
				    glclear();
				    glenable("blend");
				    glblendfunc("src_alpha","one_minus_src_alpha");
				  }
				</code>
		    </description>
  		</jsmethod>
  	</jsmethod_list>

	<jsmethod_list name="Sketch OpenGL">
  		<jsmethod name="glbegin">
		    <arglist>
		    	<arg name="draw_prim" type=""/>
		    </arglist>
  		</jsmethod>
		<jsmethod name="glbindtexture">
		    <arglist>
		    	<arg name="image_object" type="String"/>
		    </arglist>
		    <description>
		    	Note: this method also calls glenable(texture)
		    </description>
  		</jsmethod>

  		<jsmethod name="glblendfunc">
		    <arglist>
		    	<arg name="src_function" type="String"/>
		    	<arg name="dst_function" type="String"/>
		    </arglist>
  		</jsmethod>

    	<jsmethod name="glclear">
  		</jsmethod>

    	<jsmethod name="glclearcolor">
		    <arglist>
		    	<arg name="red" type="Number"/>
		    	<arg name="green" type="Number"/>
		    	<arg name="blue" type="Number"/>
		    	<arg name="alpha" type="Number"/>
		    </arglist>
  		</jsmethod>

    	<jsmethod name="glcleardepth">
		    <arglist>
		    	<arg name="depth" type="Number"/>
		    </arglist>
  		</jsmethod>

    	 <jsmethod name="glclipplane">
		    <arglist>
		    	<arg name="plane" type="Number"/>
		    	<arg name="coeff1" type="Number"/>
		    	<arg name="coeff2" type="Number"/>
		    	<arg name="coeff3" type="Number"/>
		    	<arg name="coeff4" type="Number"/>
		    </arglist>
  		</jsmethod>

    	<jsmethod name="glcolor">
		    <arglist>
		    	<arg name="red" type="Number"/>
		    	<arg name="green" type="Number"/>
		    	<arg name="blue" type="Number"/>
		    	<arg name="alpha" type="Number"/>
		    </arglist>
  		</jsmethod>

    	<jsmethod name="glcolormask">
		    <arglist>
		    	<arg name="red" type="Number"/>
		    	<arg name="green" type="Number"/>
		    	<arg name="blue" type="Number"/>
		    	<arg name="alpha" type="Number"/>
		    </arglist>
  		</jsmethod>

    	  		<jsmethod name="glcolormaterial">
		    <arglist>
		    	<arg name="face" type="Number"/>
		    	<arg name="mode" type=""/>
		    </arglist>
  		</jsmethod>

		<jsmethod name="glcullface">
		    <arglist>
		    	<arg name="face" type="Number"/>
		    </arglist>
  		</jsmethod>

    	  		<jsmethod name="gldepthmask">
		    <arglist>
		    	<arg name="on" type="Number"/>
		    </arglist>
  		</jsmethod>

		<jsmethod name="gldepthrange">
		    <arglist>
		    	<arg name="near" type="Number"/>
		    	<arg name="far" type="Number"/>
		    </arglist>
  		</jsmethod>

    	  		<jsmethod name="gldisable">
		    <arglist>
		    	<arg name="capability" type="Number"/>
		    </arglist>
  		</jsmethod>

    	<jsmethod name="gldrawpixels">
		    <arglist>
		    	<arg name="image" type="String"/>
		    </arglist>
  		</jsmethod>

    	<jsmethod name="gledgeflag">
		    <arglist>
		    	<arg name="on" type="Number"/>
		    </arglist>
  		</jsmethod>

    	<jsmethod name="glenable">
		    <arglist>
		    	<arg name="capability" type="Number"/>
		    </arglist>
  		</jsmethod>

    	<jsmethod name="glend">
  		</jsmethod>

    	<jsmethod name="glfinish">
  		</jsmethod>

    	<jsmethod name="glflush">
  		</jsmethod>

    	<jsmethod name="glfog">
		    <arglist>
		    	<arg name="parameter_name, value" type="String"/>
		    	<arg name="value" type="Number"/>
		    </arglist>
  		</jsmethod>

    	<jsmethod name="glfrustum">
		    <arglist>
		    	<arg name="left" type="Number"/>
		    	<arg name="right" type="Number"/>
		    	<arg name="bottom" type="Number"/>
		    	<arg name="top" type="Number"/>
		    	<arg name="near" type="Number"/>
		    	<arg name="far" type="Number"/>
		    </arglist>
  		</jsmethod>

    	<jsmethod name="glhint">
		    <arglist>
		    	<arg name="target" type="String"/>
		    	<arg name="mode" type="Number"/>
		    </arglist>
  		</jsmethod>

    	<jsmethod name="gllight">
		    <arglist>
		    	<arg name="light" type="String"/>
		    	<arg name="parameter_name" type="String"/>
		    	<arg name="value" type="Number"/>
		    </arglist>
  		</jsmethod>

    	<jsmethod name="gllightmodel">
		    <arglist>
		    	<arg name="parameter_name" type="String"/>
		    	<arg name="value" type="Number"/>
		    </arglist>
  		</jsmethod>

    	  		<jsmethod name="gllinestipple">
		    <arglist>
		    	<arg name="factor" type=""/>
		    	<arg name="bit-pattern" type=""/>
		    </arglist>
  		</jsmethod>

    	<jsmethod name="gllinewidth">
		    <arglist>
		    	<arg name="width" type="Number"/>
		    </arglist>
  		</jsmethod>

    	<jsmethod name="glloadidentity">
  		</jsmethod>

    	<jsmethod name="glloadmatrix">
		    <arglist>
		    	<arg name="matrix_array" type="Array"/>
		    </arglist>
  		</jsmethod>

    	<jsmethod name="gllogicop">
		    <arglist>
		    	<arg name="opcode" type=""/>
		    </arglist>
  		</jsmethod>

    	<jsmethod name="glmaterial">
  		</jsmethod>

    	<jsmethod name="glmatrixmode">
		    <arglist>
		    	<arg name="mode" type="String"/>
		    </arglist>
  		</jsmethod>

    	<jsmethod name="glmultmatrix">
		    <arglist>
		    	<arg name="matrix_array" type="Array"/>
		    </arglist>
  		</jsmethod>

    	<jsmethod name="glnormal">
		    <arglist>
		    	<arg name="x" type="Number"/>
		    	<arg name="y" type="Number"/>
		    	<arg name="z" type="Number"/>
		    </arglist>
  		</jsmethod>

    	  		<jsmethod name="glortho">
		    <arglist>
		    	<arg name="left" type="Number"/>
		    	<arg name="right" type="Number"/>
		    	<arg name="bottom" type="Number"/>
		    	<arg name="top" type="Number"/>
		    	<arg name="near" type="Number"/>
		    	<arg name="far" type="Number"/>
		    </arglist>
  		</jsmethod>

    	  		<jsmethod name="glpointsize">
		    <arglist>
		    	<arg name="size" type="Number"/>
		    </arglist>
  		</jsmethod>

    	  		<jsmethod name="glpolygonmode">
		    <arglist>
		    	<arg name="face" type="Number"/>
		    	<arg name="mode" type="Number"/>
		    </arglist>
		</jsmethod>

    	<jsmethod name="glpolygonoffset">
		    <arglist>
		    	<arg name="factor" type="Number"/>
		    	<arg name="units" type="Number"/>
		    </arglist>
  		</jsmethod>

    	<jsmethod name="glpopattrib">
  		</jsmethod>

    	<jsmethod name="glpopmatrix">
  		</jsmethod>

    	<jsmethod name="glpushattrib">
  		</jsmethod>

    	<jsmethod name="glpushmatrix">
  		</jsmethod>

    	<jsmethod name="glrect">
		    <arglist>
		    	<arg name="x1" type="Number"/>
		    	<arg name="y1" type="Number"/>
		    	<arg name="x2" type="Number"/>
		    	<arg name="y2" type="Number"/>
		    </arglist>
  		</jsmethod>

    	<jsmethod name="glrotate">
		    <arglist>
		    	<arg name="angle" type="Number"/>
		    	<arg name="x" type="Number"/>
		    	<arg name="y" type="Number"/>
		    	<arg name="z" type="Number"/>
		    </arglist>
  		</jsmethod>

    	<jsmethod name="glscale">
		    <arglist>
		    	<arg name="x_scale" type="Number"/>
		    	<arg name="y_scale" type="Number"/>
		    	<arg name="z_scale" type="Number"/>
		    </arglist>
  		</jsmethod>

    	<jsmethod name="glscissor">
		    <arglist>
		    	<arg name="x" type="Number"/>
		    	<arg name="y" type="Number"/>
		    	<arg name="width" type="Number"/>
		    	<arg name="height" type="Number"/>
		    </arglist>
  		</jsmethod>

    	<jsmethod name="glshademodel">
		    <arglist>
		    	<arg name="mode" type=""/>
		    </arglist>
  		</jsmethod>

    	<jsmethod name="gltexcoord">
		    <arglist>
		    	<arg name="s" type=""/>
		    	<arg name="t" type=""/>
		    </arglist>
  		</jsmethod>

    	<jsmethod name="gltexenv">
		    <arglist>
		    	<arg name="parameter_name" type="String"/>
		    	<arg name="val1" type="String"/>
		    	<arg name="val2" type="String"/>
		    	<arg name="val3" type="String"/>
		    	<arg name="val4" type="String"/>
		    </arglist>
  		</jsmethod>

    	<jsmethod name="gltexgen">
		    <arglist>
		    	<arg name="coord" type="Array"/>
		    	<arg name="parameter_name" type="String"/>
		    	<arg name="val1" type="String"/>
		    	<arg name="val2" type="String"/>
		    	<arg name="val3" type="String"/>
		    	<arg name="val4" type="String"/>
		    </arglist>
  		</jsmethod>

    	<jsmethod name="gltexparameter">
		    <arglist>
		    	<arg name="parameter_name" type="String"/>
		    	<arg name="val1" type="String"/>
		    	<arg name="val2" type="String"/>
		    	<arg name="val3" type="String"/>
		    	<arg name="val4" type="String"/>
		    </arglist>
  		</jsmethod>

    	<jsmethod name="gltranslate">
		    <arglist>
		    	<arg name="delta_x" type="Number"/>
		    	<arg name="delta_y" type="Number"/>
		    	<arg name="delta_z" type="Number"/>
		    </arglist>
  		</jsmethod>

    	<jsmethod name="glulookat">
		    <arglist>
		    	<arg name="eye_x" type="Number"/>
		    	<arg name="eye_y" type="Number"/>
		    	<arg name="eye_z" type="Number"/>
		    	<arg name="center_x" type="Number"/>
		    	<arg name="center_y" type="Number"/>
		    	<arg name="center_z" type="Number"/>
		    	<arg name="up_x" type="Number"/>
		    	<arg name="up_y" type="Number"/>
		    	<arg name="up_z" type="Number"/>
		    </arglist>
  		</jsmethod>

    	  		<jsmethod name="gluortho2d">
		    <arglist>
		    	<arg name="left" type="Number"/>
		    	<arg name="right" type="Number"/>
		    	<arg name="bottom" type="Number"/>
		    	<arg name="top" type="Number"/>
		    </arglist>
  		</jsmethod>

    	<jsmethod name="gluperspective">
		    <arglist>
		    	<arg name="fovy" type=""/>
		    	<arg name="aspect" type="Number"/>
		    	<arg name="near" type="Number"/>
		    	<arg name="far" type="Number"/>
		    </arglist>
  		</jsmethod>

    	<jsmethod name="glvertex">
		    <arglist>
		    	<arg name="x" type="Number"/>
		    	<arg name="y" type="Number"/>
		    	<arg name="z" type="Number"/>
		    </arglist>
  		</jsmethod>

  		<jsmethod name="glviewport">
			<arglist>
		    	<arg name="x" type="Number"/>
		    	<arg name="y" type="Number"/>
		    	<arg name="width" type="Number"/>
		    	<arg name="height" type="Number"/>
		    </arglist>
		</jsmethod>
	</jsmethod_list>
</vignette>
