mirror of
https://github.com/s00500/SimpleExpressions
synced 2024-12-29 11:15:47 +00:00
experimental block definitions for facilino
This commit is contained in:
parent
264fd0a772
commit
1bb01d6dd2
46
simpleExpression_blocks.js
Normal file
46
simpleExpression_blocks.js
Normal file
@ -0,0 +1,46 @@
|
||||
Blockly.Blocks['show_mouth'] = {
|
||||
category: 'SimpleExpressions',
|
||||
colour: '#fbb117',
|
||||
helpUrl: Facilino.getHelpUrl('show_mouth'),
|
||||
tags: [],
|
||||
examples: [],
|
||||
init: function() {
|
||||
this.appendDummyInput()
|
||||
.appendField("showMouth");
|
||||
this.appendValueInput("Color")
|
||||
.setCheck(null)
|
||||
.appendField("Color");
|
||||
this.setColour("#fbb117");
|
||||
this.setTooltip("");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Blockly.Arduino['show_mouth'] = function(block) {
|
||||
var input_color = Blockly.Arduino.valueToCode(block, 'Color', Blockly.Arduino.ORDER_ATOMIC);
|
||||
var code='SimpleExpressions.showMouth("+'mouth_name'+", '+color+')';
|
||||
code+= '\n';
|
||||
return code;
|
||||
};
|
||||
|
||||
Blockly.Blocks['play_sound'] = {
|
||||
category: 'SimpleExpressions',
|
||||
colour: '#fbb117',
|
||||
helpUrl: Facilino.getHelpUrl('play_sound'),
|
||||
tags: [],
|
||||
examples: [],
|
||||
init: function() {
|
||||
this.appendDummyInput()
|
||||
.appendField("play Sound");
|
||||
this.setColour("#fbb117");
|
||||
this.setTooltip("");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Blockly.Arduino['play_sound'] = function(block) {
|
||||
var input_color = Blockly.Arduino.valueToCode(block, 'Color', Blockly.Arduino.ORDER_ATOMIC);
|
||||
var code='';
|
||||
code+= '\n';
|
||||
return code;
|
||||
};
|
Loading…
Reference in New Issue
Block a user