mirror of
https://github.com/scratchfoundation/scratch-blocks.git
synced 2025-06-13 05:12:17 -04:00
Add play note block to default toolbox for testing
This commit is contained in:
parent
d03a3fe8f8
commit
d17267bf72
2 changed files with 44 additions and 0 deletions
blocks_vertical
|
@ -548,5 +548,17 @@ Blockly.Blocks.defaultToolbox = '<xml id="toolbox-categories" style="display: no
|
|||
'</shadow>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'<block type="extension_music_play_note" id="extension_microbit_display">' +
|
||||
'<value name="NOTE">' +
|
||||
'<shadow type="math_number">' +
|
||||
'<field name="NUM">60</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'<value name="BEATS">' +
|
||||
'<shadow type="math_number">' +
|
||||
'<field name="NUM">0.25</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'</category>' +
|
||||
'</xml>';
|
||||
|
|
|
@ -260,3 +260,35 @@ Blockly.Blocks['extension_microbit_display'] = {
|
|||
});
|
||||
}
|
||||
};
|
||||
|
||||
Blockly.Blocks['extension_music_play_note'] = {
|
||||
/**
|
||||
* @this Blockly.Block
|
||||
*/
|
||||
init: function() {
|
||||
this.jsonInit({
|
||||
"message0": "%1 %2 play note %3 for %4 beats",
|
||||
"args0": [
|
||||
{
|
||||
"type": "field_image",
|
||||
"src": Blockly.mainWorkspace.options.pathToMedia + "extensions/music-block-icon.svg",
|
||||
"width": 40,
|
||||
"height": 40
|
||||
},
|
||||
{
|
||||
"type": "field_vertical_separator"
|
||||
},
|
||||
{
|
||||
"type": "input_value",
|
||||
"name": "NOTE"
|
||||
},
|
||||
{
|
||||
"type": "input_value",
|
||||
"name": "BEATS"
|
||||
}
|
||||
],
|
||||
"category": Blockly.Categories.pen,
|
||||
"extensions": ["colours_pen", "shape_statement", "scratch_extension"]
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue