The samples below should allow you to get a feel for how to use jcotton. Selecting a sample from the right will copy the code into the texbox in the middle and execute it. You can see other sections of the tutorial by using the navigation on the top. You can modify the code and press the "->" button to re-run the code. In these examples I have already created the sampleCanvas object by running var tutorialCanvas = jcotton.canvas("tutorialCanvas") which creates a canvas object for the canvas with id "tutorialCanvas".

No Canvas Support
A drawable element can be added to the canvas by calling .add(), passing in one of the many drawable objects in jcotton. In this example I am drawing a rectangle with x,y coordinates (from the top left) of 125, 125, with a width and height both of 50.