mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-07-12 05:54:02 -04:00
Update for RenderWebGLLocal -> RenderWebGL (#181)
* Update for RenderWebGLLocal -> RenderWebGL * Move button under title
This commit is contained in:
parent
6b3f0d3d8a
commit
542899949e
4 changed files with 16 additions and 23 deletions
|
@ -35,10 +35,10 @@
|
|||
<pre id="blockexplorer"></pre>
|
||||
</div>
|
||||
<div id="tab-importexport">
|
||||
<button id="createEmptyProject">New Project</button><br />
|
||||
Import/Export<br />
|
||||
Project ID: <input id="projectId" value="119615668" />
|
||||
<button id="projectLoadButton">Load</button><br />
|
||||
<button id="projectLoadButton">Load</button>
|
||||
<button id="createEmptyProject">New Project</button><br />
|
||||
<p>
|
||||
<input type="button" value="Export to XML" onclick="toXml()">
|
||||
|
||||
|
|
|
@ -30,7 +30,8 @@ window.onload = function() {
|
|||
document.location = '#' + document.getElementById('projectId').value;
|
||||
location.reload();
|
||||
};
|
||||
document.getElementById('createEmptyProject').addEventListener('click', function() {
|
||||
document.getElementById('createEmptyProject').addEventListener('click',
|
||||
function() {
|
||||
document.location = '#' + 'createEmptyProject';
|
||||
location.reload();
|
||||
});
|
||||
|
@ -38,7 +39,7 @@ window.onload = function() {
|
|||
|
||||
// Instantiate the renderer and connect it to the VM.
|
||||
var canvas = document.getElementById('scratch-stage');
|
||||
window.renderer = new window.RenderWebGLLocal(canvas);
|
||||
window.renderer = new window.RenderWebGL(canvas);
|
||||
|
||||
// Instantiate scratch-blocks and attach it to the DOM.
|
||||
var toolbox = document.getElementById('toolbox');
|
||||
|
|
|
@ -29,19 +29,16 @@ Mouse.prototype.postData = function(data) {
|
|||
|
||||
Mouse.prototype._activateClickHats = function (x, y) {
|
||||
if (self.renderer) {
|
||||
var pickPromise = self.renderer.pick(x, y);
|
||||
var instance = this;
|
||||
pickPromise.then(function(drawableID) {
|
||||
for (var i = 0; i < instance.runtime.targets.length; i++) {
|
||||
var target = instance.runtime.targets[i];
|
||||
if (target.hasOwnProperty('drawableID') &&
|
||||
target.drawableID == drawableID) {
|
||||
instance.runtime.startHats('event_whenthisspriteclicked',
|
||||
null, target);
|
||||
return;
|
||||
}
|
||||
var drawableID = self.renderer.pick(x, y);
|
||||
for (var i = 0; i < this.runtime.targets.length; i++) {
|
||||
var target = this.runtime.targets[i];
|
||||
if (target.hasOwnProperty('drawableID') &&
|
||||
target.drawableID == drawableID) {
|
||||
this.runtime.startHats('event_whenthisspriteclicked',
|
||||
null, target);
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -39,13 +39,8 @@ util.inherits(Clone, Target);
|
|||
*/
|
||||
Clone.prototype.initDrawable = function () {
|
||||
if (this.renderer) {
|
||||
var createPromise = this.renderer.createDrawable();
|
||||
var instance = this;
|
||||
createPromise.then(function (id) {
|
||||
instance.drawableID = id;
|
||||
// Once the drawable is created, send our current set of properties.
|
||||
instance.updateAllDrawableProperties();
|
||||
});
|
||||
this.drawableID = this.renderer.createDrawable();
|
||||
this.updateAllDrawableProperties();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue