forked from ajaxorg/ace
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplotdevice.snippets
More file actions
254 lines (244 loc) · 6.38 KB
/
plotdevice.snippets
File metadata and controls
254 lines (244 loc) · 6.38 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
### general purpose
snippet {
{"${1:k}":${2:v}, kw$3}
snippet kw
"${1:k}":${2:v}, kw$3
snippet dict
dict(${1:k}=${2:v}, dkw$3)
snippet dkw
${1:k}=${2:v}, dkw$3
snippet t
True
snippet f
False
snippet lorem
"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
snippet draw
def draw(state):
print FRAME$1
snippet setup
def setup(state):
$1
snippet stop
def stop(state):
$1
snippet anim
speed(${1:30})$2
def setup(state):
pass
def draw(state):
print FRAME
def stop(state):
pass
### Some handy abbreviations borrowed from python.snippets
snippet imp
import ${1:module}
snippet xi
${1:library} = ximport("$1")
snippet from
from ${1:package} import ${2:module}
snippet wh
while ${1:condition}:
$2
snippet with
with ${1:expr} as ${2:var}:
$3
# New Class
snippet cl
class ${1:ClassName}(${2:object}):
"""${3:docstring for $1}"""
def __init__(self, ${4:arg}):
${5:super($1, self).__init__()}
$6
# New Function
snippet def
def ${1:fname}($2):
$3
# New Method
snippet defs
def ${1:mname}(self, ${2:arg}):
$3
# Ifs
snippet if
if ${1:condition}:
$2
snippet el
else:
$1
snippet ei
elif ${1:condition}:
$2
# For
snippet for
for ${1:item} in ${2:items}:
$3
snippet try
try:
${1:# TODO: write code...}
except ${2:Exception}, ${3:e}:
${4:raise $3}
# if __name__ == '__main__':
snippet ifmain
if __name__ == '__main__':
${1:main()}
# __magic__
snippet _
__${1:init}__${2}
### signatures for the plotdevice api
snippet align
align(${1:LEFT/RIGHT/CENTER/JUSTIFY})
snippet alpha
alpha(${1:1.0})
snippet arc
arc(${1:x}, ${2:y}, ${3:radius}${4:, range=${5:None}, ccw=${6:False}, close=${7:False}})
snippet arcto
arcto(${1:x}, ${2:y}${3:, cx=${4:None}, cy=${5:None}, radius=${6:None}, ccw=${7:False}, close=${8:False}})
snippet arrow
arrow(${1:x}, ${2:y}${3:, width=${4:100}, type=${5:NORMAL/FORTYFIVE}, plot=${6:True}})
snippet autoclosepath
autoclosepath(${1:close=${2:True}})
snippet autotext
autotext(${1:sourceFile})
snippet background
background()
snippet beginclip
beginclip(${1:stencil}${2:, mask=${3:False}, channel=${4:None}})
snippet beginpath
beginpath(${1:${2:x}, ${3:y}})
snippet bezier
bezier(${1:${2:x}, ${3:y}}, close=${4:True}, plot=${5:True})
snippet blend
blend("${1:normal}")
snippet capstyle
capstyle(${1:style=${2:BUTT/ROUND/SQUARE}})
snippet choice
choice(${1:seq})
snippet clear
clear(${1:all})
snippet clip
clip(${1:stencil}${2:, channel="${3:black/white/alpha/red/green/blue}"})
snippet mask
mask(${1:stencil}${2:, channel="${3:black/white/alpha/red/green/blue}"})
snippet closepath
closepath()
snippet color
color("${1:black}")
snippet colormode
colormode(${1:mode=${2:RGB/HSB/CMYK}, range=${3:None}})
snippet colorrange
colorrange(${1:maxval})
snippet curveto
curveto(${1:x1}, ${2:y1}, ${3:x2}, ${4:y2}, ${5:x}, ${6:y}${7:, close=${8:False}})
snippet drawpath
drawpath(${1:path})
snippet ellipse
ellipse(${1:x}, ${2:y}, ${3:width}, ${4:height}${5:, range=${6:None}, ccw=${7:False}, close=${8:False}, plot=${9:True}})
snippet endclip
endclip()
snippet endpath
endpath(${1:plot=${2:True}})
snippet export
export("${1:${2:document}.${3:mov}}"${4:, fps=${5:None}, loop=${6:None}, bitrate=${7:1.0}})
snippet files
files("${1:${2:*}.${3:json}}", case=${4:True}})
snippet fill
fill(${1:"#${2:000}"})
snippet findpath
findpath(${1:points}${2:, curvature=${3:1.0}})
snippet findvar
findvar(${1:name})
snippet font
font("${1:HelveticaNeue-Medium}", ${2:12}})
snippet fonts
fonts(${1:like="${2:akzidenz}", western=${3:True}})
snippet fontsize
fontsize(${1:12})
snippet geometry
geometry(${1:DEGREES/RADIANS/PERCENT})
snippet grid
grid(${1:cols}, ${2:rows}${3:, colSize=${4:1}, rowSize=${5:1}, shuffled=${6:False}})
snippet image
image("${1:image.png}", ${2:x}, ${3:y}${4:, width=${5:None}, height=${6:None}, plot=${7:True}})
snippet imagesize
imagesize("${1:image.png}"${2:, data=${3:None}})
snippet joinstyle
joinstyle(${1:MITER/ROUND/BEVEL})
snippet line
line(${1:x1}, ${2:y1}, ${3:x2}, ${4:y2}${5:, plot=${6:True}})
snippet lineheight
lineheight(${1:None})
snippet lineto
lineto(${1:x}, ${2:y}${3:, close=${4:False}})
snippet measure
measure(${1:obj})
snippet moveto
moveto(${1:x}, ${2:y})
snippet nofill
nofill()
snippet nostroke
nostroke()
snippet noshadow
noshadow()
snippet ordered
ordered(${1:seq})
snippet outputmode
outputmode(${1:RGB/HSB/CMYK})
snippet oval
oval(${1:x}, ${2:y}, ${3:width}, ${4:height}${5:, range=${6:None}, ccw=${7:False}, close=${8:False}, plot=${9:True}})
snippet pen
pen(${1:nib})
snippet plot
plot(${1:obj})
snippet poly
poly(${1:x}, ${2:y}, ${3:radius}, ${4:sides}${5:, plot=${6:True}})
snippet pop
pop()
snippet push
push()
snippet random
random(${1:v1=${2:None}, v2=${3:None}})
snippet read
read(${1:pth}${2:, format=${3:None}, encoding=${4:utf-8}, cols=${5:None}})
snippet rect
rect(${1:x}, ${2:y}, ${3:width}, ${4:height}${5:, roundness=${6:0.0}, plot=${7:True}})
snippet reset
reset()
snippet rotate
rotate(${1:theta})
snippet scale
scale(${1:x=${2:1}, y=${3:None}})
snippet shadow
shadow(${1:"black"}, blur=${2:10}, offset=${3:10})))
snippet shuffled
shuffled(${2:seq})
snippet size
size(${1:width}, ${2:height}, unit=${4:px}})
snippet skew
skew(${1:horizontal}, ${2:vertical})
snippet speed
speed(${1:fps})
snippet star
star(${1:x}, ${2:y}${3:, points=${4:20}, outer=${5:100}, inner=${6:None}, plot=${7:True}}})
snippet stroke
stroke()
snippet strokewidth
strokewidth(${1:width})
snippet text
text("${1:txt}", ${2:x}, ${3:y}${4:, width=${5:None}, height=${6:None}, outline=${7:False}, plot=${8:True}})
snippet textheight
textheight("${1:txt}"${2:, width=${3:None}})
snippet textmetrics
textmetrics("${1:txt}"${2:, width=${3:None}, height=${4:None}})
snippet textpath
textpath("${1:txt}", ${2:x}, ${3:y}${4:, width=${5:None}, height=${6:None}})
snippet textwidth
textwidth("${1:txt}"${2:, width=${3:None}})
snippet transform
transform()
snippet transform()
with transform(${1:${2:CENTER/CORNER, }${3:...}}):
$4
snippet translate
translate(${1:x}, ${2:y})
snippet ximport
${1:libName} = ximport("$1")