mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-06-08 03:24:56 -04:00
Add green flag and stop button to playground
This commit is contained in:
parent
1ab391281d
commit
bbc66a95a7
3 changed files with 13 additions and 2 deletions
playground
|
@ -9,8 +9,11 @@
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="vm-devtools">
|
<div id="vm-devtools">
|
||||||
|
<h2>Scratch VM Playground</h2>
|
||||||
|
<button id="greenflag">Green flag</button>
|
||||||
|
<button id="stopall">Stop</button>
|
||||||
<div id="tab-blockexplorer">
|
<div id="tab-blockexplorer">
|
||||||
<h2>VM Block Representation</h2>
|
<h3>VM Block Representation</h3>
|
||||||
<pre id="blockexplorer"></pre>
|
<pre id="blockexplorer"></pre>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -20,7 +20,7 @@ body {
|
||||||
#blockexplorer {
|
#blockexplorer {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 80%;
|
height: 75%;
|
||||||
overflow: scroll;
|
overflow: scroll;
|
||||||
border: 1px solid #fff;
|
border: 1px solid #fff;
|
||||||
background: rgb(36,36,36);
|
background: rgb(36,36,36);
|
||||||
|
|
|
@ -23,4 +23,12 @@ window.onload = function() {
|
||||||
|
|
||||||
// Run threads
|
// Run threads
|
||||||
vm.runtime.start();
|
vm.runtime.start();
|
||||||
|
|
||||||
|
// Handlers for green flag and stop all.
|
||||||
|
document.getElementById('greenflag').addEventListener('click', function() {
|
||||||
|
vm.runtime.greenFlag();
|
||||||
|
});
|
||||||
|
document.getElementById('stopall').addEventListener('click', function() {
|
||||||
|
vm.runtime.stopAll();
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue