Canvas Snippets is a plugin for SublimeText 2 & 3 to make coding with HTML5 Canvas API a little easier.
Download the latest version:
Install it via Package Control.
- Install PackageControl
- Find PackageControl in the Command Palette(
CTRL+SHIFT+P) - Search for
Canvas Snippetsand Install it.
Using these snippets are as easy as typeing the first two letters of a Method and Entering Tab.
Examples:
- To revel the
stroke()method, typestand PressTab. - To insert the
rotate()method, typeroand PressTab.
And So on.........
For when the Method/Property names are more than one word, type the second word's first two letters with the first two letters of the first word like in the examples below.
- To revel the
shadowColorproperty, typeshcoand PressTab. - To insert the
beginPath()method, typebepaand PressTab.
And So on.........
NOTE: Remember everything you type before entering the Tab must be in Lower Case.
Up until this release you would have to type context or ctx or whatever you have named the Canvas' Context and then the tabtrigger to insert a snippet but, from here on you don't have to enter the Context, it set to "ctx" as default and cannot be changed.
So, if you type fi
previously it would just be fill()
but now it will be ctx.fill()
I have also added a CheatSheet.txt which you can make use of when using these snippets.
If you have any doubts about how to use a snippet, please refer to my CheatSheet File or
If something is not working right please make an issue HERE