2

Empty C blocks

If presenting the material using an iterative approach or to tests student's knowledge you leave a space where a block would have been by using the "space" instruction.

                                if <key [space] pressed?> then
  space
  space
  space
else
  move (10) steps
                            
Black & white image showing an empty C-block using the space directive in English

Highlighting a block

Blocks can be highlighted by prefixing them with the "highlight" directive. The block will be outlined with a black dashed line.

                                when I start as a clone
show
go to x (pick random (-235) to (235)) y (170)
repeat until < (yposition) lt (-170)>
  highlight!change y by (-5)
delete this clone
                            
Full colored Scratch script showing a highlighted block in English

Auto hints

Auto hints list the block categories of the blocks used to build an instruction. This is very useful when the color option is "Black & White" and students may need assistance locating the blocks

To enable Auto Hints just tick the check box on the convert options

                                when flag clicked
go to x: (0) y: (0)
pen down
repeat (4)
  move (100) steps
  turn right (90) degrees
                            
Black & White image of Scratch script with category hints in English

Manual hints

Manual hints can be used to provide special instructions to students on a per block basis.

After the block text simple append a tilda followed by the desired text e.g. "move (10) steps ~ what happens when the value is increased"

Note that when provided manual hints always override Auto HInts.

                                when flag clicked
hide
set size to (70) %
forever
  create clone of [myself]
  wait (1) seconds ~ Is this long enough?
                            
Black & white image of Scratch script showing a manually added hint in English

Converting multiple scripts

Multiple scripts can be converted simultaneously by separating the scripts in the editor with 5 or more dashes ":-----"

When multiple scripts are converted a "zip" file will also be produced containing the converted images.

                                when flag clicked
hide
create clone of [myself]
-----
when I start as a clone
go to x (-240) y (0)
show
                            
Black & white image of two Scratch scripts produced simultaneously in English using the multi-script separator

Specify the filename for the image

An image name can be specified for each script by preceding the script with a filename directive following two dashes, for example "-- filename: figure_1.jpg":

NOTE: We support both ".jpg" and ".png" extensions. Images generated with a ".png" extension will have a transparent background automatically.

                                -- filename: apple_sprite.png
when flag clicked
set [Score] to (0)
set [Apples Missed] to (0)
hide
set size to (70) %
forever
  create clone of [myself]
  wait (1) seconds
                            
Colored outline image of Scratch script in English

MyBlocks

MyBlocks can be defined using the "define!" directive. This must be the first block in the script

The defined block can then be used in subsequent scripts (using the multi-script separator).

NOTE:The defined block with not validate in the editor and will appear as an error unless you mark it with the "myblock!" directive. It will however convert successfully.

                                define!create (x) balls
repeat (parameter!x)
  create clone of [Ball]
-----
when flag clicked
myblock!create (10) balls
                            
Full colored image of Scratch script showing MyBlock definition and use in English

Vanity blocks

Vanity blocks can be specified by prefixing the line with the "vanity!": directive.

The system will choose a random color from the block categories (not including the extensions). If you want the block to be a specific block category color you can append the category to the vanity directive for example "vanity-looks!": or "vanity-motion!":

                                vanity!happy birthday
                            
Example of a vanity Scratch block "Happy Birthday"

micro:bit display []

To specify what to display use an "1" for on and and "0" for off in a row by row (row 1 to row 5) configurations separated by commas for example display [01010,10101,10001,01010,00100]
                                display [01010,10101,10001,01010,00100]
                            
Black & white image of Microbit display block in English showing a heart icon

Category directives

Many of the blocks in the MakeyMakey, micro:bit, Lego EV3, Lego Boost, Lego WeDo 2.0 and Force & Acceleration extensions share identical signatures which make it impossible to differentiate them unless a category directive is provided. All the blocks listed below should be specified with a category directive e.g. "boost!" otherwise the wrong block may be matched.

makey!when [SPACE] key pressed

microbit!when [moved]
microbit!when tilted [any]
microbit!tilt angle [front]

ev3!distance

boost!motor [A] position
boost!when tilted [any]
boost!tilt angle [up]
boost!set light color to (50)

wedo!set light color to (50)
wedo!when tilted [any]
wedo!distance
wedo!tilted [any]
wedo!tilt angle [up]

fa!when [shaken]
fa!when tilted [any]
fa!tilted [any]
fa!tilt angle [front]

                                boost!set light color to (50)
seperator
wedo!set light color to (50)
                            
Colored outline image of Scratch blocks with identical syntax. A category directive is required to differentiate between them.

Scale factor

When creating blocks to print for unplugged activities. Use the scale_factor instruction to ensure that all blocks have the same size connectors. The scale factor can be specified on the first script and all subsequent scrips, in a multi-script conversion, will use the same scale factor. Prefix the script with "-- scale_factor: " to specify the desired scale factor.

If you are unsure what scale factor to use. Convert the longest block first and then check the scale factor it was created with on the My Account/Conversions page and use that scale factor on subsequent conversions.

The scale factor instruction can only be used if you have signed up for the Educator Plus plan.

                                -- scale_factor: 3
when flag clicked
                            
Black & white image of large Scratch block in English produced with 'scale_factor' instruction