Under the setMovable() documentation it says that it can be set on initialization. How can I initialize with a block already in the workspace?
--
You received this message because you are subscribed to the Google Groups "Blockly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blockly+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
this.setMovable(false);
When set to false, the user will not be able to move the block within the workspace. If this setter is not called, the block defaults to being movable (unless Blockly was initialized as readonly).
Any block (even unmovable ones) may be moved programmatically once they are on a workspace by calling block.moveBy(dx, dy)
. The starting position for a block on a workspace defaults to (0, 0) unless otherwise specified.
That is helpful as I would like to be able to initialize blocks in certain locations; I guess my problem is I do not know where the initialization of blocks in the workspace happen. Where can I declare the blocks that I want to be placed in the workspace when the page is loaded?