mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 10:47:11 +02:00
add a tablet button for photobooth
This commit is contained in:
parent
5ec3bbde52
commit
18db5f1724
1 changed files with 21 additions and 2 deletions
|
@ -1,9 +1,28 @@
|
||||||
|
//
|
||||||
|
// photobooth.js
|
||||||
|
// scripts/developer/utilities/render/photobooth
|
||||||
|
//
|
||||||
|
// Created by Howard Stearns on 2 Nov 2016
|
||||||
|
// Copyright 2016 High Fidelity, Inc.
|
||||||
|
//
|
||||||
|
// Distributed under the Apache License, Version 2.0.
|
||||||
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
//
|
||||||
|
/* globals Tablet, Toolbars, Script, HMD, Controller, Menu */
|
||||||
(function () {
|
(function () {
|
||||||
var SNAPSHOT_DELAY = 500; // 500ms
|
var SNAPSHOT_DELAY = 500; // 500ms
|
||||||
var PHOTOBOOTH_WINDOW_HTML_URL = Script.resolvePath("./html/photobooth.html");
|
var PHOTOBOOTH_WINDOW_HTML_URL = Script.resolvePath("./html/photobooth.html");
|
||||||
var PHOTOBOOTH_SETUP_JSON_URL = Script.resolvePath("./photoboothSetup.json");
|
var PHOTOBOOTH_SETUP_JSON_URL = Script.resolvePath("./photoboothSetup.json");
|
||||||
var toolbar = Toolbars.getToolbar("com.highfidelity.interface.toolbar.system");
|
|
||||||
var MODEL_BOUNDING_BOX_DIMENSIONS = {x: 1.0174,y: 1.1925,z: 1.0165};
|
var MODEL_BOUNDING_BOX_DIMENSIONS = {x: 1.0174,y: 1.1925,z: 1.0165};
|
||||||
|
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
||||||
|
var button = tablet.addButton({
|
||||||
|
icon: "icons/tablet-icons/snap-i.svg",
|
||||||
|
text: "PHOTOBOOTH"
|
||||||
|
});
|
||||||
|
function onClicked() {
|
||||||
|
PhotoBooth.init();
|
||||||
|
}
|
||||||
|
button.clicked.connect(onClicked);
|
||||||
|
|
||||||
var PhotoBooth = {};
|
var PhotoBooth = {};
|
||||||
PhotoBooth.init = function () {
|
PhotoBooth.init = function () {
|
||||||
|
@ -96,7 +115,6 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
var main = function () {
|
var main = function () {
|
||||||
PhotoBooth.init();
|
|
||||||
|
|
||||||
var photoboothWindowListener = {};
|
var photoboothWindowListener = {};
|
||||||
photoboothWindowListener.onLoad = function (event) {
|
photoboothWindowListener.onLoad = function (event) {
|
||||||
|
@ -172,6 +190,7 @@
|
||||||
function cleanup() {
|
function cleanup() {
|
||||||
Camera.mode = "first person";
|
Camera.mode = "first person";
|
||||||
PhotoBooth.destroy();
|
PhotoBooth.destroy();
|
||||||
|
tablet.removeButton(button);
|
||||||
}
|
}
|
||||||
Script.scriptEnding.connect(cleanup);
|
Script.scriptEnding.connect(cleanup);
|
||||||
}());
|
}());
|
Loading…
Reference in a new issue