-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathblocks.xml
More file actions
324 lines (300 loc) · 8.13 KB
/
blocks.xml
File metadata and controls
324 lines (300 loc) · 8.13 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
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<palette>
<block tag="get-text-data"
spec="text from file: %0"
code="DataUtils.getTextData(~)"
help="Gets text from a file in your game's 'extras' folder. For more info, right-click and press 'View Help'."
type="normal"
color="lime"
returns="text">
<fields>
<text order="0"/>
</fields>
</block>
<block tag="split-text-lines"
spec="split %0 into lines"
code="~.split("\r")"
help="Splits a multi-line text file into a list."
type="normal"
color="lime"
returns="list">
<fields>
<text order="0"/>
</fields>
</block>
<block tag="line-break"
spec="line break"
code=""\r""
help="Returns a line break as text."
type="normal"
color="lime"
returns="text">
<fields/>
</block>
<block tag="text-with-breaks"
spec="replace \r with line break in %0"
code="StringTools.replace(~, "\\r", "\r")"
help="Replaces any instances of \r in the text with a line break. Useful for adding multiple lines."
type="normal"
color="lime"
returns="text">
<fields>
<text order="0"/>
</fields>
</block>
<block tag="text-without-breaks"
spec="replace line break with \r in %0"
code="StringTools.replace(~, "\r", "\\r")"
help="Replaces any line breaks in the text with \r. Useful for debugging purposes."
type="normal"
color="lime"
returns="text">
<fields>
<text order="0"/>
</fields>
</block>
<block tag="remove-breaks"
spec="remove line breaks from %0"
code="StringTools.replace(~, "\r", "")"
help="Removes any line breaks from the text."
type="normal"
color="lime"
returns="text">
<fields>
<text order="0"/>
</fields>
</block>
<block tag="add-line-break"
spec="add line: %1 to %0"
code="~ += "\r" + ~;"
help="Adds a line of text to the text attribute."
type="action"
color="lime"
returns="void">
<fields>
<text order="0"/>
<text order="1"/>
</fields>
</block>
<block tag="append-line"
spec="append line %1 to file: %0"
code="DataUtils.appendLine(~, ~);"
help="DOES NOT WORK ON FLASH OR HTML5. // Adds a line of text to the end of the file. Useful for generating logs."
type="action"
color="red"
returns="void">
<fields>
<text order="0"/>
<text order="1"/>
</fields>
</block>
<block tag="unicode-text"
spec="unicode text: %0"
code=""~""
help="Returns the text with Unicode characters preserved."
type="normal"
color="lime"
returns="text">
<fields>
<camera order="0"/>
</fields>
</block>
<!-- EXPERIMENTAL
<block tag="remove-char"
spec="remove all %1 from %0"
code="DataUtils.removeSpecial(~, ~)"
help="Removes every instance of the special character from the text."
type="normal"
color="lime"
returns="text">
<fields>
<text order="0"/>
<dropdown order="1">
<choices>
<c text="line breaks" code="0"/>
<c text="tabs" code="1"/>
</choices>
</dropdown>
</fields>
</block> -->
<block tag="draw-list"
spec="draw list %0 at ( x: %1 y: %2 )"
code="DataUtils.drawList(g, ~, ~, ~);"
help="Draws a list onto the screen, item by item. Use only in drawing events."
type="action"
color="cyan"
returns="void">
<fields>
<list order="0"/>
<number order="1"/>
<number order="2"/>
</fields>
</block>
<block tag="print-list"
spec="print list %0"
code="for (item in ~) trace(item);"
help="Prints a list to the console, item by item."
type="action"
color="gray"
returns="void">
<fields>
<list order="0"/>
</fields>
</block>
<block tag="get-sound-data"
spec="sound from file: %0"
code="DataUtils.getSoundData(~)"
help="Gets a sound from a file in the game's 'extras' folder. DO NOT include the file extension (.mp3 or .ogg). For more info, right-click and press 'View Help'."
type="normal"
color="red"
returns="sound">
<fields>
<text order="0"/>
</fields>
</block>
<block tag="image-file"
spec="image from file: %0 [i:draw]"
code="DataUtils.getImageData(~)"
help="Gets a image from a file in the game's 'extras' folder. For more info, right-click and press 'View Help'."
type="normal"
color="cyan"
returns="image">
<fields>
<text order="0"/>
</fields>
</block>
<block tag="play-swf-data"
spec="play [i:flash] swf from file: %0 at ( x: %1 y: %2 ) [e:dash] when done..."
code="PlaySWF.playSWF(~, ~, ~, function() {~});"
help="ONLY WORKS ON FLASH. // Plays an SWF file (.swf) from your game's 'extras' folder. For more info, right-click and press 'View Help'."
type="wrapper"
color="red"
hidden="true"
returns="void">
<fields>
<text order="0"/>
<number order="1"/>
<number order="2"/>
<CODE_BLOCK order="3"/>
</fields>
</block>
<block tag="play-avm1-data"
spec="play [i:flash] avm1 from file: %0 for %1 seconds [e:dash] when done..."
code="PlaySWF.playAVM1(~, 1000 * ~, function() {~});"
help="ONLY WORKS ON FLASH. // Plays an AVM1 SWF file (.swf) from the game's 'extras' folder. For more info, right-click and press 'View Help'."
type="wrapper"
color="red"
hidden="true"
returns="void">
<fields>
<text order="0"/>
<number order="1"/>
<CODE_BLOCK order="2"/>
</fields>
</block>
<block tag="movie-data-loaded"
spec="swf loaded [i:flash]"
code="loaded"
help="Use inside the play swf block."
type="normal"
color="red"
hidden="true"
returns="boolean">
<fields/>
</block>
<block tag="play-movie-data"
spec="play [i:flash] from file: %0 at ( x: %1 y: %2 ) [e:dash] %4"
code="PlaySWF.playMovie(~, ~, ~, function(loaded) {~});"
help="ONLY WORKS ON FLASH. // Plays an .swf file from the game's 'extras' folder. For more info, right-click and press 'View Help'."
type="wrapper"
color="red"
returns="void">
<fields>
<text order="0"/>
<number order="1"/>
<number order="2"/>
<CODE_BLOCK order="3"/>
<attached-block order="4" tag="movie-data-loaded"/>
</fields>
</block>
<block tag="stop-movie-data"
spec="close [i:flash] movie from file: %0"
code="PlaySWF.stopMovie(~);"
help="ONLY WORKS ON FLASH. // Stops and closes the .swf file if it's currently running. For more info, right-click and press 'View Help'."
type="action"
color="red"
returns="void">
<fields>
<text order="0"/>
</fields>
</block>
<block tag="data-save-success-red"
spec="save successful [i:save]"
code="success"
help="Use inside the save text block."
type="normal"
color="red"
hidden="true"
returns="boolean">
<fields/>
</block>
<block tag="data-save-success-cyan"
spec="save successful [i:save]"
code="success"
help="Use inside the save image block."
type="normal"
color="cyan"
hidden="true"
returns="boolean">
<fields/>
</block>
<block tag="save-text-data"
spec="save data %1 to file: %0 [e:dash] %3"
code="FileSave.saveText(~, ~, function(success:Bool) {~});"
help="DOES NOT WORK ON FLASH OR HTML5. // Saves a text file to the game's 'extras' folder."
type="wrapper"
color="red"
returns="void">
<fields>
<text order="0"/>
<text order="1"/>
<CODE_BLOCK order="2"/>
<attached-block order="3" tag="data-save-success-red"/>
</fields>
</block>
<block tag="save-image-data"
spec="save PNG %1 to file: %0 [e:dash] %3"
code="FileSave.savePNG(~, ~, function(success:Bool) {~});"
help="DOES NOT WORK ON FLASH OR HTML5. // Saves an image file as a .png to the game's 'extras' folder."
type="wrapper"
color="cyan"
hidden="true"
returns="void">
<fields>
<text order="0"/>
<image order="1"/>
<CODE_BLOCK order="2"/>
<attached-block order="3" tag="data-save-success-cyan"/>
</fields>
</block>
<block tag="save-image-png-jpg"
spec="save %0 %2 to file: %1 [e:dash] %4"
code="FileSave.save~(~, ~, function(success:Bool) {~});"
help="DOES NOT WORK ON FLASH OR HTML5. // Saves an image file to the game's 'extras' folder."
type="wrapper"
color="cyan"
returns="void">
<fields>
<dropdown order="0">
<choices>
<c text="PNG" code="PNG"/>
<c text="JPEG" code="JPG"/>
</choices>
</dropdown>
<text order="1"/>
<image order="2"/>
<CODE_BLOCK order="3"/>
<attached-block order="4" tag="data-save-success-cyan"/>
</fields>
</block>
</palette>