mirror of
https://github.com/scratchfoundation/scratch-blocks.git
synced 2025-08-28 22:10:31 -04:00
Add math_integer block and use it in go back _ layers (#513)
This commit is contained in:
parent
d3ea97cecc
commit
b7c7cbd20f
2 changed files with 23 additions and 1 deletions
|
@ -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.
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue