Add math_integer block and use it in go back _ layers (#513)

This commit is contained in:
Tim Mickel 2016-07-12 14:33:26 -04:00 committed by GitHub
parent d3ea97cecc
commit b7c7cbd20f
2 changed files with 23 additions and 1 deletions

View file

@ -53,6 +53,28 @@ Blockly.Blocks['math_number'] = {
}
};
Blockly.Blocks['math_integer'] = {
/**
* Block for integer value (no decimal, + or -).
* @this Blockly.Block
*/
init: function() {
this.jsonInit({
"message0": "%1",
"args0": [
{
"type": "field_number",
"name": "NUM",
"precision": 1
}
],
"output": "Number",
"outputShape": Blockly.OUTPUT_SHAPE_ROUND,
"colour": Blockly.Colours.textField
});
}
};
Blockly.Blocks['math_whole_number'] = {
/**
* Block for whole number value, no negatives or decimals.

View file

@ -591,7 +591,7 @@
<block type="looks_gotofront"></block>
<block type="looks_gobacklayers">
<value name="NUM">
<shadow type="math_number">
<shadow type="math_integer">
<field name="NUM">1</field>
</shadow>
</value>