mirror of
https://github.com/scratchfoundation/scratch-blocks.git
synced 2025-08-28 22:10:31 -04:00
Add sample matrix block to the default toolbox
This commit is contained in:
parent
41683d1387
commit
da70a48435
4 changed files with 166 additions and 0 deletions
|
@ -541,5 +541,12 @@ Blockly.Blocks.defaultToolbox = '<xml id="toolbox-categories" style="display: no
|
|||
'</value>'+
|
||||
'</block>'+
|
||||
'<block type="extension_music_reporter" id="extension_music_reporter"></block>'+
|
||||
'<block type="extension_microbit_display" id="extension_microbit_display">'+
|
||||
'<value name="MATRIX">'+
|
||||
'<shadow type="matrix">'+
|
||||
'<field name="MATRIX">4540074</field>'+
|
||||
'</shadow>'+
|
||||
'</value>'+
|
||||
'</block>'+
|
||||
'</category>'+
|
||||
'</xml>';
|
||||
|
|
|
@ -232,3 +232,31 @@ Blockly.Blocks['extension_music_reporter'] = {
|
|||
});
|
||||
}
|
||||
};
|
||||
|
||||
Blockly.Blocks['extension_microbit_display'] = {
|
||||
/**
|
||||
* @this Blockly.Block
|
||||
*/
|
||||
init: function() {
|
||||
this.jsonInit({
|
||||
"message0": "%1 %2 display %3",
|
||||
"args0": [
|
||||
{
|
||||
"type": "field_image",
|
||||
"src": Blockly.mainWorkspace.options.pathToMedia + "extensions/microbit-block-icon.svg",
|
||||
"width": 40,
|
||||
"height": 40
|
||||
},
|
||||
{
|
||||
"type": "field_vertical_separator"
|
||||
},
|
||||
{
|
||||
"type": "input_value",
|
||||
"name": "MATRIX"
|
||||
},
|
||||
],
|
||||
"category": Blockly.Categories.more,
|
||||
"extensions": ["colours_more", "shape_statement", "scratch_extension"]
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
130
media/extensions/microbit-block-icon.svg
Normal file
130
media/extensions/microbit-block-icon.svg
Normal file
|
@ -0,0 +1,130 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="32px"
|
||||
height="32px"
|
||||
viewBox="0 0 32 32"
|
||||
version="1.1"
|
||||
id="svg2"
|
||||
inkscape:version="0.48.5 r10040"
|
||||
sodipodi:docname="icon--add-wedo.svg">
|
||||
<metadata
|
||||
id="metadata35">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title>wedo-add-button</dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<sodipodi:namedview
|
||||
pagecolor="#0300ff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1356"
|
||||
inkscape:window-height="782"
|
||||
id="namedview33"
|
||||
showgrid="false"
|
||||
inkscape:zoom="10.429825"
|
||||
inkscape:cx="10.763285"
|
||||
inkscape:cy="18.198471"
|
||||
inkscape:window-x="76"
|
||||
inkscape:window-y="13"
|
||||
inkscape:window-maximized="0"
|
||||
inkscape:current-layer="svg2" />
|
||||
<!-- Generator: Sketch 43.2 (39069) - http://www.bohemiancoding.com/sketch -->
|
||||
<title
|
||||
id="title4">wedo-add-button</title>
|
||||
<desc
|
||||
id="desc6">Created with Sketch.</desc>
|
||||
<defs
|
||||
id="defs8">
|
||||
<path
|
||||
d="M2,1.00752069 C2,0.451082376 2.45303631,0 2.99703014,0 L9.00296986,0 C9.5536144,0 10,0.442541372 10,1.00752069 L10,3.99267578 L2,3.99267578 L2,1.00752069 Z"
|
||||
id="path-1" />
|
||||
<path
|
||||
d="M14,1.00752069 C14,0.451082376 14.4530363,0 14.9970301,0 L21.0029699,0 C21.5536144,0 22,0.442541372 22,1.00752069 L22,3.99267578 L14,3.99267578 L14,1.00752069 Z"
|
||||
id="path-2" />
|
||||
<rect
|
||||
id="path-3"
|
||||
x="0"
|
||||
y="4"
|
||||
width="24"
|
||||
height="16"
|
||||
rx="1" />
|
||||
</defs>
|
||||
<g
|
||||
id="g3963"
|
||||
transform="translate(0.17521071,29.898305)">
|
||||
<rect
|
||||
style="opacity:0.12000002;fill:none;stroke:#000000;stroke-width:3.74534345;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
id="rect3937"
|
||||
width="25.859743"
|
||||
height="14.334317"
|
||||
x="2.8949177"
|
||||
y="-21.065464"
|
||||
rx="7.2730522" />
|
||||
<rect
|
||||
rx="6.5593219"
|
||||
y="-20.067797"
|
||||
x="4.1637712"
|
||||
height="12.338983"
|
||||
width="23.322035"
|
||||
id="rect3935"
|
||||
style="fill:none;stroke:#ffffff;stroke-width:3.29999995;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
|
||||
<path
|
||||
sodipodi:type="arc"
|
||||
style="opacity:0.12000002;fill:#000000;fill-opacity:1;stroke:none"
|
||||
id="path3959"
|
||||
sodipodi:cx="12.542373"
|
||||
sodipodi:cy="-13.491526"
|
||||
sodipodi:rx="1.559322"
|
||||
sodipodi:ry="1.559322"
|
||||
d="m 14.101695,-13.491526 c 0,0.86119 -0.698133,1.559322 -1.559322,1.559322 -0.86119,0 -1.559322,-0.698132 -1.559322,-1.559322 0,-0.861189 0.698132,-1.559322 1.559322,-1.559322 0.861189,0 1.559322,0.698133 1.559322,1.559322 z"
|
||||
transform="matrix(1.4304128,0,0,1.4304128,-7.4264489,5.4001468)" />
|
||||
<path
|
||||
transform="translate(-2.0280507,-0.40677897)"
|
||||
d="m 14.101695,-13.491526 c 0,0.86119 -0.698133,1.559322 -1.559322,1.559322 -0.86119,0 -1.559322,-0.698132 -1.559322,-1.559322 0,-0.861189 0.698132,-1.559322 1.559322,-1.559322 0.861189,0 1.559322,0.698133 1.559322,1.559322 z"
|
||||
sodipodi:ry="1.559322"
|
||||
sodipodi:rx="1.559322"
|
||||
sodipodi:cy="-13.491526"
|
||||
sodipodi:cx="12.542373"
|
||||
id="path3945"
|
||||
style="fill:#ffffff;fill-opacity:1;stroke:none"
|
||||
sodipodi:type="arc" />
|
||||
<path
|
||||
transform="matrix(1.4304128,0,0,1.4304128,3.1945515,5.4001464)"
|
||||
d="m 14.101695,-13.491526 c 0,0.86119 -0.698133,1.559322 -1.559322,1.559322 -0.86119,0 -1.559322,-0.698132 -1.559322,-1.559322 0,-0.861189 0.698132,-1.559322 1.559322,-1.559322 0.861189,0 1.559322,0.698133 1.559322,1.559322 z"
|
||||
sodipodi:ry="1.559322"
|
||||
sodipodi:rx="1.559322"
|
||||
sodipodi:cy="-13.491526"
|
||||
sodipodi:cx="12.542373"
|
||||
id="path3961"
|
||||
style="opacity:0.12000002;fill:#000000;fill-opacity:1;stroke:none"
|
||||
sodipodi:type="arc" />
|
||||
<path
|
||||
sodipodi:type="arc"
|
||||
style="fill:#ffffff;fill-opacity:1;stroke:none"
|
||||
id="path3947"
|
||||
sodipodi:cx="12.542373"
|
||||
sodipodi:cy="-13.491526"
|
||||
sodipodi:rx="1.559322"
|
||||
sodipodi:ry="1.559322"
|
||||
d="m 14.101695,-13.491526 c 0,0.86119 -0.698133,1.559322 -1.559322,1.559322 -0.86119,0 -1.559322,-0.698132 -1.559322,-1.559322 0,-0.861189 0.698132,-1.559322 1.559322,-1.559322 0.861189,0 1.559322,0.698133 1.559322,1.559322 z"
|
||||
transform="translate(8.5929493,-0.40677897)" />
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 4.9 KiB |
|
@ -10,6 +10,7 @@
|
|||
<script src="../msg/messages.js"></script>
|
||||
<script src="../blocks_vertical/vertical_extensions.js"></script>
|
||||
<script src="../blocks_common/math.js"></script>
|
||||
<script src="../blocks_common/matrix.js"></script>
|
||||
<script src="../blocks_common/text.js"></script>
|
||||
<script src="../blocks_common/colour.js"></script>
|
||||
<script src="../blocks_vertical/control.js"></script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue