|
1 |
| -Below is a list of all the methods and properties of the Canvas' Context followed by its respective tabtrigger |
| 1 | +Below is a list of all the methods and properties of the Canvas' Context followed by its respective tabtrigger. |
2 | 2 |
|
| 3 | +#### Example: |
| 4 | + 1. To revel "fillStyle" property, type "fist" and enter TAB |
| 5 | + 2. To insert "clearRect()" methods, type "clre" and enter TAB |
| 6 | + and so on............ |
| 7 | + |
| 8 | +#### How to Use this CheatSheet: |
| 9 | + ctx.method/property - TabTrigger + TAB |
| 10 | + |
| 11 | +#### Note: |
| 12 | + 1. The Canvas' Context is set to "ctx" and cannot be changed |
| 13 | + 2. There are some MISC snippets, take a look at the MISC section |
| 14 | + 3. If you use Canvas Snippets often, save this file for easy reference |
3 | 15 |
|
4 | 16 | ### COLOR, STYLE and SHADOW
|
5 |
| -* fillStyle - `fist` |
6 |
| -* strokeStyle - `stat` |
7 |
| -* shadowColor - `shco` |
8 |
| -* shadowBlur - `shbl` |
9 |
| -* shadowOffsetX - `sox` |
10 |
| -* shadowOffsetY - `soy` |
11 |
| -* createLinearGradient() - `clg` |
12 |
| -* createRadialGradient() - `crg` |
13 |
| -* createPattern() - `cp` |
14 |
| -* addColorStop() - `acs` |
| 17 | +* ctx.fillStyle - `fist` + `TAB` |
| 18 | +* ctx.strokeStyle - `stat` + `TAB` |
| 19 | +* ctx.shadowColor - `shco` + `TAB` |
| 20 | +* ctx.shadowBlur - `shbl` + `TAB` |
| 21 | +* ctx.shadowOffsetX - `sox` + `TAB` |
| 22 | +* ctx.shadowOffsetY - `soy` + `TAB` |
| 23 | +* ctx.createLinearGradient() - `clg` + `TAB` |
| 24 | +* ctx.createRadialGradient() - `crg` + `TAB` |
| 25 | +* ctx.createPattern() - `cp` + `TAB` |
| 26 | +* ctx.addColorStop() - `acs` + `TAB` |
15 | 27 |
|
16 | 28 |
|
17 | 29 | ### LINE STYLE
|
18 |
| -* lineCap - `lic` |
19 |
| -* lineJoin - `lijo` |
20 |
| -* lineWidth - `liwi` |
21 |
| -* miterLimit - `mili` |
| 30 | +* ctx.lineCap - `lic` + `TAB` |
| 31 | +* ctx.lineJoin - `lijo` + `TAB` |
| 32 | +* ctx.lineWidth - `liwi` + `TAB` |
| 33 | +* ctx.miterLimit - `mili` + `TAB` |
22 | 34 |
|
23 | 35 |
|
24 | 36 | ### RECTANGLE
|
25 |
| -* rect() - `re` |
26 |
| -* fillRect() - `fire` |
27 |
| -* strokeRect() - `stre` |
28 |
| -* clearRect() - `clre` |
| 37 | +* ctx.rect() - `re` + `TAB` |
| 38 | +* ctx.fillRect() - `fire` + `TAB` |
| 39 | +* ctx.strokeRect() - `stre` + `TAB` |
| 40 | +* ctx.clearRect() - `clre` + `TAB` |
29 | 41 |
|
30 | 42 |
|
31 | 43 | ### PATH
|
32 |
| -* fill() - `fi` |
33 |
| -* stroke() - `st` |
34 |
| -* beginPath() - `bepa` |
35 |
| -* closePath() - `clpa` |
36 |
| -* moveTo() - `mot` |
37 |
| -* lineTo() - `lit` |
38 |
| -* quadraticCurveTo() - `qua` |
39 |
| -* bezierCurveTo() - `bez` |
40 |
| -* arc() - `ar` |
41 |
| -* arcTo() - `art` |
42 |
| -* clip() - `cl` |
43 |
| -* isPointInPath() - `ipip` |
| 44 | +* ctx.fill() - `fi` + `TAB` |
| 45 | +* ctx.stroke() - `st` + `TAB` |
| 46 | +* ctx.beginPath() - `bepa` + `TAB` |
| 47 | +* ctx.closePath() - `clpa` + `TAB` |
| 48 | +* ctx.moveTo() - `mot` + `TAB` |
| 49 | +* ctx.lineTo() - `lit` + `TAB` |
| 50 | +* ctx.quadraticCurveTo() - `qua` + `TAB` |
| 51 | +* ctx.bezierCurveTo() - `bez` + `TAB` |
| 52 | +* ctx.arc() - `ar` + `TAB` |
| 53 | +* ctx.arcTo() - `art` + `TAB` |
| 54 | +* ctx.clip() - `cl` + `TAB` |
| 55 | +* ctx.isPointInPath() - `ipip` + `TAB` |
44 | 56 |
|
45 | 57 |
|
46 | 58 | ### TRANSFORMATION
|
47 |
| -* scale() - `sc` |
48 |
| -* rotate() - `ro` |
49 |
| -* translate() - `trsl` |
50 |
| -* transform() - `trsf` |
51 |
| -* setTransform() - `strsf` |
| 59 | +* ctx.scale() - `sc` + `TAB` |
| 60 | +* ctx.rotate() - `ro` + `TAB` |
| 61 | +* ctx.translate() - `trsl` + `TAB` |
| 62 | +* ctx.transform() - `trsf` + `TAB` |
| 63 | +* ctx.setTransform() - `strsf` + `TAB` |
52 | 64 |
|
53 | 65 |
|
54 | 66 | ### TEXT/FONT
|
55 |
| -* font - `fo` |
56 |
| -* textAlign - `teal` |
57 |
| -* textBaseline - `teba` |
58 |
| -* fillText() - `fite` |
59 |
| -* strokeText() - `stte` |
60 |
| -* measureText() - `mete` |
| 67 | +* ctx.font - `fo` + `TAB` |
| 68 | +* ctx.textAlign - `teal` + `TAB` |
| 69 | +* ctx.textBaseline - `teba` + `TAB` |
| 70 | +* ctx.fillText() - `fite` + `TAB` |
| 71 | +* ctx.strokeText() - `stte` + `TAB` |
| 72 | +* ctx.measureText() - `mete` + `TAB` |
61 | 73 |
|
62 | 74 |
|
63 | 75 | ### IMAGE DRAWING
|
64 |
| -* drawImage() - `dr` |
| 76 | +* ctx.drawImage() - `dr` + `TAB` |
65 | 77 |
|
66 | 78 |
|
67 | 79 | ### PIXAL MANIPULATION
|
68 |
| -* width - `wi` |
69 |
| -* height - `he` |
70 |
| -* data - `da` |
71 |
| -* createImageData() - `cid` |
72 |
| -* getImageData() - `gid` |
73 |
| -* putImageData() - `pid` |
| 80 | +* ctx.width - `wi` + `TAB` |
| 81 | +* ctx.height - `he` + `TAB` |
| 82 | +* ctx.data - `da` + `TAB` |
| 83 | +* ctx.createImageData() - `cid` + `TAB` |
| 84 | +* ctx.getImageData() - `gid` + `TAB` |
| 85 | +* ctx.putImageData() - `pid` + `TAB` |
74 | 86 |
|
75 | 87 |
|
76 | 88 | ### COMPOSITING
|
77 |
| -* globalAlpha - `glal` |
78 |
| -* globalCompositeOperation - `glco` |
| 89 | +* ctx.globalAlpha - `glal` + `TAB` |
| 90 | +* ctx.globalCompositeOperation - `glco` + `TAB` |
79 | 91 |
|
80 | 92 |
|
81 | 93 | ### OTHER
|
82 |
| -* save() - `sa` |
83 |
| -* restore() - `res` |
84 |
| -* createEvent() - `crev` |
85 |
| -* getContext() - `gco` |
86 |
| -* toDataURL() - `tdu` |
| 94 | +* ctx.save() - `sa` + `TAB` |
| 95 | +* ctx.restore() - `res` + `TAB` |
| 96 | +* ctx.createEvent() - `crev` + `TAB` |
| 97 | +* ctx.getContext() - `gco` + `TAB` |
| 98 | +* ctx.toDataURL() - `tdu` + `TAB` |
87 | 99 |
|
88 | 100 |
|
89 | 101 | ### MICS
|
90 |
| -* HTML BoilerPlate with a Canvas Tag - `htmlcan` |
91 |
| -* Canvas Tag with useful Attributes - `cat` |
92 |
| -* Height - `he` |
93 |
| -* Width - `wi` |
94 |
| -* Data - `da` |
95 |
| -* Math.PI - `pi` |
96 |
| -* Math.random - `rnd` |
97 |
| -* Initialize Canvas and Context - `initcan` |
| 102 | +* ctx.HTML BoilerPlate with a Canvas Tag - `htmlcan` + `TAB` |
| 103 | +* ctx.Canvas Tag with useful Attributes - `cat` + `TAB` |
| 104 | +* ctx.Height - `he` + `TAB` |
| 105 | +* ctx.Width - `wi` + `TAB` |
| 106 | +* ctx.Data - `da` + `TAB` |
| 107 | +* ctx.Math.PI - `pi` + `TAB` |
| 108 | +* ctx.Math.random - `rnd` + `TAB` |
| 109 | +* ctx.Initialize Canvas and Context - `initcan` + `TAB` |
0 commit comments