-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.txt
45 lines (40 loc) · 1.15 KB
/
test.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
!This is the code used by the compiler to generate a javascript canvas code file
! ! indicates a comment
! # pound sign indicates a code block
! $$ enclosing dollar signs indicates a variable that may need to be replaced to avoid duplicated variables
! "" empty parentheses indicates a value that needs to be set by compiler
! empty lines will be skipped
#onload
window.onload = function() {
var canvasId = "";
var canvasName = "";
var canvasWidth = "";
var canvasHeight = "";
var canvas = document.createElement('canvas');
canvas.id = canvasId;
canvas.setAttribute("height",canvasWidth);
canvas.setAttribute("width",canvasHeight);
document.body.appendChild(canvas);
var context = canvas.getContext('2d');
!begin free draw code
#moveContext
var $x$ = "";
var $y$ = "";
context.beginPath();
context.MoveTo($x$,$y$);
#lineTo
var $px$ = 105;
var $py$ = 105;
context.lineTo($px$,$py$);
#stroke
var $freeDrawStroke$ = "";
var $freeDrawColor$ = "";
context.lineWidth = $freeDrawStroke$;
context.strokeStyle = $freeDrawColor$;
context.stroke();
!end free draw
#circle
#rectangle
!no code blocks should come after closeOnload
#closeOnload
}