From 25a1108b612e9d78a2de8a157f37b272b3491cce Mon Sep 17 00:00:00 2001 From: Bing Shearer Date: Wed, 8 Jul 2015 16:24:23 -0700 Subject: [PATCH 1/3] Fixed spelling error --- libraries/script-engine/src/ScriptEngine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/script-engine/src/ScriptEngine.cpp b/libraries/script-engine/src/ScriptEngine.cpp index 55cf9e9890..2046fd622d 100644 --- a/libraries/script-engine/src/ScriptEngine.cpp +++ b/libraries/script-engine/src/ScriptEngine.cpp @@ -493,7 +493,7 @@ void ScriptEngine::evaluate() { QScriptValue result = evaluate(_scriptContents); - // TODO: why do we check this twice? It seems like the call to clearExcpetions() in the lower level evaluate call + // TODO: why do we check this twice? It seems like the call to clearExceptions() in the lower level evaluate call // will cause this code to never actually run... if (hasUncaughtException()) { int line = uncaughtExceptionLineNumber(); From 6080ec4509ae1292dc8db991fcbcf31ea262afc2 Mon Sep 17 00:00:00 2001 From: Bing Shearer Date: Wed, 8 Jul 2015 16:29:43 -0700 Subject: [PATCH 2/3] Air Hockey UI now follows window border --- examples/example/games/airHockey.js | 69 ++++++++++++++++++++--------- 1 file changed, 47 insertions(+), 22 deletions(-) mode change 100644 => 100755 examples/example/games/airHockey.js diff --git a/examples/example/games/airHockey.js b/examples/example/games/airHockey.js old mode 100644 new mode 100755 index a703f379bc..f70fbc232f --- a/examples/example/games/airHockey.js +++ b/examples/example/games/airHockey.js @@ -83,35 +83,60 @@ var puck_name_index = 2; var light_name_index = 3; var floor_name_index = 4; +//Create Spawn and Del. Button Vars. + +function updateButtonPosition() { + Overlays.editOverlay(spawnButton, { + x: screenSize.x / 2 + PADDING, + y: screenSize.y - (BUTTON_SIZE * 2 + PADDING), + }); + Overlays.editOverlay(deleteButton, { + x: screenSize.x / 2 - BUTTON_SIZE, + y: screenSize.y - (BUTTON_SIZE * 2 + PADDING), + }); +} + +function onScriptUpdate() { + var oldScreenSize = screenSize; + + screenSize = Controller.getViewportDimensions(); + + if (screenSize.x !== oldScreenSize.x || screenSize.y !== oldScreenSize.y) { + updateButtonPosition(); + } +} + +screenSize = Controller.getViewportDimensions(); var deleteButton = Overlays.addOverlay("image", { - x: screenSize.x / 2 - BUTTON_SIZE, - y: screenSize.y - (BUTTON_SIZE * 2 + PADDING), - width: BUTTON_SIZE, - height: BUTTON_SIZE, - imageURL: HIFI_PUBLIC_BUCKET + "images/delete.png", - color: { - red: 255, - green: 255, - blue: 255 - }, - alpha: 1 + x: screenSize.x / 2 - BUTTON_SIZE, + y: screenSize.y - (BUTTON_SIZE * 2 + PADDING), + width: BUTTON_SIZE, + height: BUTTON_SIZE, + imageURL: HIFI_PUBLIC_BUCKET + "images/delete.png", + color: { + red: 255, + green: 255, + blue: 255 + }, + alpha: 1 }); var spawnButton = Overlays.addOverlay("image", { - x: screenSize.x / 2 + PADDING, - y: screenSize.y - (BUTTON_SIZE * 2 + PADDING), - width: BUTTON_SIZE, - height: BUTTON_SIZE, - imageURL: HIFI_PUBLIC_BUCKET + "images/puck.png", - color: { - red: 255, - green: 255, - blue: 255 - }, - alpha: 1 + x: screenSize.x / 2 + PADDING, + y: screenSize.y - (BUTTON_SIZE * 2 + PADDING), + width: BUTTON_SIZE, + height: BUTTON_SIZE, + imageURL: HIFI_PUBLIC_BUCKET + "images/puck.png", + color: { + red: 255, + green: 255, + blue: 255 + }, + alpha: 1 }); +Script.update.connect(onScriptUpdate); var floor, edge1, edge2, edge3a, edge3b, edge4a, edge4b, light; From ba4049754ae7f237e3d1d2a44884abf22b8641d4 Mon Sep 17 00:00:00 2001 From: Bing Shearer Date: Wed, 8 Jul 2015 16:53:55 -0700 Subject: [PATCH 3/3] Restored indentatioN --- examples/example/games/airHockey.js | 44 ++++++++++++++--------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/examples/example/games/airHockey.js b/examples/example/games/airHockey.js index f70fbc232f..ca7f007df6 100755 --- a/examples/example/games/airHockey.js +++ b/examples/example/games/airHockey.js @@ -109,31 +109,31 @@ function onScriptUpdate() { screenSize = Controller.getViewportDimensions(); var deleteButton = Overlays.addOverlay("image", { - x: screenSize.x / 2 - BUTTON_SIZE, - y: screenSize.y - (BUTTON_SIZE * 2 + PADDING), - width: BUTTON_SIZE, - height: BUTTON_SIZE, - imageURL: HIFI_PUBLIC_BUCKET + "images/delete.png", - color: { - red: 255, - green: 255, - blue: 255 - }, - alpha: 1 + x: screenSize.x / 2 - BUTTON_SIZE, + y: screenSize.y - (BUTTON_SIZE * 2 + PADDING), + width: BUTTON_SIZE, + height: BUTTON_SIZE, + imageURL: HIFI_PUBLIC_BUCKET + "images/delete.png", + color: { + red: 255, + green: 255, + blue: 255 + }, + alpha: 1 }); var spawnButton = Overlays.addOverlay("image", { - x: screenSize.x / 2 + PADDING, - y: screenSize.y - (BUTTON_SIZE * 2 + PADDING), - width: BUTTON_SIZE, - height: BUTTON_SIZE, - imageURL: HIFI_PUBLIC_BUCKET + "images/puck.png", - color: { - red: 255, - green: 255, - blue: 255 - }, - alpha: 1 + x: screenSize.x / 2 + PADDING, + y: screenSize.y - (BUTTON_SIZE * 2 + PADDING), + width: BUTTON_SIZE, + height: BUTTON_SIZE, + imageURL: HIFI_PUBLIC_BUCKET + "images/puck.png", + color: { + red: 255, + green: 255, + blue: 255 + }, + alpha: 1 }); Script.update.connect(onScriptUpdate);