https://github.com/cipherboy/jcanvas
A 2D HTML5 Canvas API
https://github.com/cipherboy/jcanvas
Last synced: 12 months ago
JSON representation
A 2D HTML5 Canvas API
- Host: GitHub
- URL: https://github.com/cipherboy/jcanvas
- Owner: cipherboy
- Created: 2013-06-30T05:25:51.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2014-12-14T16:24:01.000Z (over 11 years ago)
- Last Synced: 2025-02-03T18:07:48.206Z (about 1 year ago)
- Language: JavaScript
- Size: 133 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
Awesome Lists containing this project
README
jCanvas v2.0 - A 2D HTML5 Canvas API
Copyright (C) 2011, 2013 Alex Scheel
All rights reserved.
Licensed under BSD 2 Clause License:
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
A 2D HTML5 Canvas API
Example usage (blue circle):
frame = "b,a:5:5:3:0:" + 2*Math.PI + ",fs:#00F,f,c";
jCanvasDraw(canvas, ctx, frame);
Frame can use any of the following drawing commands
Drawing Commands:
a - arc
at - arcTo
b - beginPath
c - closePath
cs - clearRect
cw - clear screen (via resetting width)
f - fill
fs - fillStyle
j - lineJoin
l - lineTo
m - moveTo
q - quadraticCurveTo
r - fillRect
s - stroke
ss - strokeStyle
w - lineWidth
: - Separate arguments
, - Separate commands
/ - Comment until next comma
Examples:
https://github.com/cipherboy/Snakey - Snakey clone in HTML5