This repository has been archived by the owner on Feb 26, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
toast
Andy C edited this page Sep 16, 2015
·
4 revisions
The toast block accepts a text object (variable or string) and will add a message to your game's notification panel and Local Chat log when run.
Block Definition:
Blockly.Blocks['toast'] = {
init: function() {
this.appendValueInput("text")
.setCheck("String")
.setAlign(Blockly.ALIGN_RIGHT)
.appendField("toast");
this.appendDummyInput()
.appendField("to you");
this.setInputsInline(true);
this.setPreviousStatement(true);
this.setNextStatement(true);
this.setColour(270);
this.setTooltip('Add a message to your in-game notification panel');
this.setHelpUrl('https://github.com/ChildrenOfUr/Ilmenscript/wiki/toast');
}
};
Code Generator:
Blockly.JavaScript['toast'] = function(block) {
var value_text = Blockly.JavaScript.valueToCode(block, 'text', Blockly.JavaScript.ORDER_ATOMIC);
return 'transmit("ilmenscript_toast", "' + value_text + '");\n';
};
To request a custom block in the game, please contact us. We'd love to hear your ideas!
Ilmenscript is based on Google Blockly. Check the official Blockly wiki for help on the Blockly core blocks (everything outside of the Game category).