I was building a blockly app, and i customized my own blocks and stuff but when you create your own block in block factory, you can get the function of that block isn't? so...
My question is...
how can i put methods on the blocks? for example....
Blockly.Blocks['my_block'] = {
init: function () {
this.appendDummyInput()
.appendField("Avanza una posición");
this.setPreviousStatement(true);
this.setNextStatement(true);
this.setColour(290);
this.setTooltip('');
}
};
Blockly.JavaScript['my_block'] = function (block) {
// TODO: Assemble JavaScript into code variable.
return DO SOMETHING
};
someone who can help?