Skip to content
This repository has been archived by the owner on Feb 26, 2019. It is now read-only.
Andy C edited this page Sep 16, 2015 · 4 revisions

toast <text> to you

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';
};

Block Factory

Ilmenscript is based on Google Blockly. Check the official Blockly wiki for help on the Blockly core blocks (everything outside of the Game category).

Clone this wiki locally