Adding Camera and iOS to window globals

This commit is contained in:
Tim Mickel 2016-01-22 14:15:15 -05:00
parent 5ba2f40efc
commit 8c2a26a070
2 changed files with 8 additions and 2 deletions

View file

@ -342,3 +342,6 @@ export default class iOS {
}
}
}
// Expose iOS methods for ScratchJr tablet sharing callbacks
window.iOS = iOS;

View file

@ -24,12 +24,12 @@ export default class Camera {
available = newAvailable;
}
static startFeed (target) {
static startFeed (feedTarget) {
ScratchAudio.sndFX('entertap.wav');
if (!Paint.canvasFits()) {
Paint.scaleToFit();
}
target = target;
target = feedTarget;
Camera.active = true;
var devicePixelRatio = window.devicePixelRatio;
var viewbox = SVGTools.getBox(target).rounded();
@ -196,3 +196,6 @@ export default class Camera {
}
}
}
// Exposing the camera for the tablet callback in iOS.snapShot
window.Camera = Camera;