Fermat
Search
K

When Unsnap

You can execute a code every time a block is unsnapped by using the when unsnap event:
when unsnap [BLOCK-ID] ([ID]):
[body]
end
There's an implicit it that can be used inside the body of the method to reference the unsnapped block.
For instance, let's make a text that when it is unsnapped to some other block, this other block changes the background colour to pink:
when unsnap me:
set it.background to "pink"
end
Alternatively, you can define the naming of the it reference:
when unsnap me (unsnapped):
set unsnapped.background to "pink"
end
Last modified 1yr ago