mirror of
https://github.com/scratchfoundation/scratch-blocks.git
synced 2025-08-01 16:51:10 -04:00
Layer blocks change "go to front/back" and "go forward/backward N layer"
This commit is contained in:
parent
32a689e38a
commit
ee13c2d5be
2 changed files with 26 additions and 8 deletions
blocks_vertical
|
@ -193,8 +193,8 @@ Blockly.Blocks.defaultToolbox = '<xml id="toolbox-categories" style="display: no
|
|||
'</shadow>'+
|
||||
'</value>'+
|
||||
'</block>'+
|
||||
'<block type="looks_gotofront" id="looks_gotofront"></block>'+
|
||||
'<block type="looks_gobacklayers" id="looks_gobacklayers">'+
|
||||
'<block type="looks_gotofrontback" id="looks_gotofrontback"></block>'+
|
||||
'<block type="looks_goforwardbackwardlayers" id="looks_goforwardbackwardlayers">'+
|
||||
'<value name="NUM">'+
|
||||
'<shadow type="math_integer">'+
|
||||
'<field name="NUM">1</field>'+
|
||||
|
|
|
@ -383,30 +383,48 @@ Blockly.Blocks['looks_backdrops'] = {
|
|||
}
|
||||
};
|
||||
|
||||
Blockly.Blocks['looks_gotofront'] = {
|
||||
Blockly.Blocks['looks_gotofrontback'] = {
|
||||
/**
|
||||
* "Go to front" Block.
|
||||
* "Go to front/back" Block.
|
||||
* @this Blockly.Block
|
||||
*/
|
||||
init: function() {
|
||||
this.jsonInit(
|
||||
{
|
||||
"message0": "go to front",
|
||||
"message0": "go to %1",
|
||||
"args0": [
|
||||
{
|
||||
"type": "field_dropdown",
|
||||
"name": "FRONT_BACK",
|
||||
"options": [
|
||||
['front', 'front'],
|
||||
['back', 'back']
|
||||
]
|
||||
}
|
||||
],
|
||||
"category": Blockly.Categories.looks,
|
||||
"extensions": ["colours_looks", "shape_statement"]
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Blockly.Blocks['looks_gobacklayers'] = {
|
||||
Blockly.Blocks['looks_goforwardbackwardlayers'] = {
|
||||
/**
|
||||
* "Go back [Number] Layers" Block.
|
||||
* "Go forward/backward [Number] Layers" Block.
|
||||
* @this Blockly.Block
|
||||
*/
|
||||
init: function() {
|
||||
this.jsonInit({
|
||||
"message0": "go back %1 layers",
|
||||
"message0": "go %1 %2 layers",
|
||||
"args0": [
|
||||
{
|
||||
"type": "field_dropdown",
|
||||
"name": "FORWARD_BACKWARD",
|
||||
"options": [
|
||||
['forward', 'forward'],
|
||||
['backward', 'backward']
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "input_value",
|
||||
"name": "NUM"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue