ability to hide tablet and take picture

This commit is contained in:
Faye Li 2017-02-17 11:32:53 -08:00
parent 217ec46222
commit 27b619030d

View file

@ -38,20 +38,23 @@
print("clicked picture button"); print("clicked picture button");
// // hide HUD tool bar // // hide HUD tool bar
// toolbar.writeProperty("visible", false); // toolbar.writeProperty("visible", false);
// // hide Overlays (such as Running Scripts or other Dialog UI) // hide tablet
// Menu.setIsOptionChecked("Overlays", false); HMD.closeTablet();
// // hide mouse cursor // hide Overlays (such as Running Scripts or other Dialog UI)
// Reticle.visible = false; Menu.setIsOptionChecked("Overlays", false);
// // giving a delay here before snapshotting so that there is time to hide toolbar and other UIs // hide mouse cursor
// // void WindowScriptingInterface::takeSnapshot(bool notify, bool includeAnimated, float aspectRatio) Reticle.visible = false;
// Script.setTimeout(function () { // // giving a delay here before snapshotting so that there is time to hide other UIs
// Window.takeSnapshot(false, false, 1.91); // void WindowScriptingInterface::takeSnapshot(bool notify, bool includeAnimated, float aspectRatio)
// // show hidden items after snapshot is taken Script.setTimeout(function () {
// toolbar.writeProperty("visible", true); Window.takeSnapshot(false, false, 1.91);
// Menu.setIsOptionChecked("Overlays", true); // show hidden items after snapshot is taken
// // unknown issue: somehow we don't need to reset cursor to visible in script and the mouse still returns after snapshot // issue: currently there's no way to show tablet via a script command. user will have to manually open tablet again
// // Reticle.visible = true; // toolbar.writeProperty("visible", true);
// }, SNAPSHOT_DELAY); Menu.setIsOptionChecked("Overlays", true);
// issue: somehow we don't need to reset cursor to visible in script and the mouse still returns after snapshot
// Reticle.visible = true;
}, SNAPSHOT_DELAY);
} else if (event.type === "onClickReloadModelButton") { } else if (event.type === "onClickReloadModelButton") {
print("clicked reload model button " + event.data.value); print("clicked reload model button " + event.data.value);
@ -161,26 +164,6 @@
}); });
Entities.deleteEntity(this.modelEntityID); Entities.deleteEntity(this.modelEntityID);
}; };
var main = function () {
var photoboothWindowListener = {};
photoboothWindowListener.onSelectCamera = function (event) {
print("selected camera " + event.value);
if (!event.hasOwnProperty("value")){
return;
}
if (event.value === "First Person Camera") {
Camera.mode = "first person";
} else {
Camera.mode = "entity";
var cameraID = PhotoBooth.cameraEntities[event.value];
Camera.setCameraEntity(cameraID);
}
};
};
main();
function cleanup() { function cleanup() {
tablet.removeButton(button); tablet.removeButton(button);