From 18db5f1724b180d7a518007f6144a7931fbdeab0 Mon Sep 17 00:00:00 2001 From: Faye Li Date: Wed, 15 Feb 2017 14:19:03 -0800 Subject: [PATCH] add a tablet button for photobooth --- .../utilities/render/photobooth/photobooth.js | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/scripts/developer/utilities/render/photobooth/photobooth.js b/scripts/developer/utilities/render/photobooth/photobooth.js index 3e86d83a98..19528f7173 100644 --- a/scripts/developer/utilities/render/photobooth/photobooth.js +++ b/scripts/developer/utilities/render/photobooth/photobooth.js @@ -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 () { var SNAPSHOT_DELAY = 500; // 500ms var PHOTOBOOTH_WINDOW_HTML_URL = Script.resolvePath("./html/photobooth.html"); 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 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 = {}; PhotoBooth.init = function () { @@ -96,7 +115,6 @@ }; var main = function () { - PhotoBooth.init(); var photoboothWindowListener = {}; photoboothWindowListener.onLoad = function (event) { @@ -172,6 +190,7 @@ function cleanup() { Camera.mode = "first person"; PhotoBooth.destroy(); + tablet.removeButton(button); } Script.scriptEnding.connect(cleanup); }()); \ No newline at end of file