From ca62e61579c4714a007051480b0148cc81725dac Mon Sep 17 00:00:00 2001 From: David Rowe Date: Sat, 6 Dec 2014 11:11:52 -0800 Subject: [PATCH] Update scripts with text overlays to use new backgroundAlpha property --- examples/ControlACs.js | 1 + examples/Recorder.js | 3 +++ examples/editModels.js | 7 +++++++ examples/fallingSand.js | 4 ++-- examples/growTrees.js | 4 ++-- examples/libraries/ExportMenu.js | 2 +- examples/libraries/ToolTip.js | 1 + examples/libraries/entityCameraTool.js | 8 ++++++++ examples/libraries/entitySelectionTool.js | 1 + examples/libraries/progressDialog.js | 2 ++ examples/libraries/toolBars.js | 8 ++++++-- examples/lobby.js | 1 + examples/newEditEntities.js | 2 ++ examples/notifications.js | 5 +++-- examples/testModelOverlaySubMeshes.js | 1 + examples/textInputOverlayExample.js | 1 + 16 files changed, 42 insertions(+), 9 deletions(-) diff --git a/examples/ControlACs.js b/examples/ControlACs.js index bbdb1cc4ef..73a4385c24 100644 --- a/examples/ControlACs.js +++ b/examples/ControlACs.js @@ -117,6 +117,7 @@ function setupToolBars() { leftMargin: TEXT_MARGIN, topMargin: TEXT_MARGIN, alpha: ALPHA_OFF, + backgroundAlpha: ALPHA_OFF, visible: true })); } diff --git a/examples/Recorder.js b/examples/Recorder.js index 8c784bcea2..ff8c449012 100644 --- a/examples/Recorder.js +++ b/examples/Recorder.js @@ -115,6 +115,7 @@ function setupTimer() { width: 0, height: 0, alpha: 1.0, + backgroundAlpha: 1.0, visible: true }); @@ -129,6 +130,7 @@ function setupTimer() { width: slider.w, height: slider.h, alpha: 1.0, + backgroundAlpha: 1.0, visible: true }); slider.foreground = Overlays.addOverlay("text", { @@ -138,6 +140,7 @@ function setupTimer() { width: slider.pos * slider.w, height: slider.h, alpha: 1.0, + backgroundAlpha: 1.0, visible: true }); diff --git a/examples/editModels.js b/examples/editModels.js index ec9e67881b..c8ad2eb254 100644 --- a/examples/editModels.js +++ b/examples/editModels.js @@ -206,6 +206,7 @@ var progressDialog = (function () { height: backgroundHeight, imageURL: backgroundUrl, alpha: 0.9, + backgroundAlpha: 0.9, visible: false }); @@ -216,6 +217,7 @@ var progressDialog = (function () { textColor: textColor, backgroundColor: textBackground, alpha: 0.9, + backgroundAlpha: 0.9, visible: false }); @@ -226,6 +228,7 @@ var progressDialog = (function () { textColor: textColor, backgroundColor: textBackground, alpha: 0.9, + backgroundAlpha: 0.9, visible: false }); @@ -1174,6 +1177,7 @@ var toolBar = (function () { topMargin: menuItemMargin, text: "Model URL", alpha: 0.9, + backgroundAlpha: 0.9, visible: false }); @@ -1183,6 +1187,7 @@ var toolBar = (function () { topMargin: menuItemMargin, text: "Model File", alpha: 0.9, + backgroundAlpha: 0.9, visible: false }); @@ -1489,6 +1494,7 @@ var ExportMenu = function (opts) { width: scaleViewWidth, height: height, alpha: 0.0, + backgroundAlpha: 0.0, color: { red: 255, green: 255, blue: 255 }, text: "1" }); @@ -2476,6 +2482,7 @@ function Tooltip() { text: "", color: { red: 228, green: 228, blue: 228 }, alpha: 0.8, + backgroundAlpha: 0.8, visible: false }); this.show = function (doShow) { diff --git a/examples/fallingSand.js b/examples/fallingSand.js index 5018aeb9ca..c85196f10e 100644 --- a/examples/fallingSand.js +++ b/examples/fallingSand.js @@ -117,7 +117,7 @@ function ScaleSelector() { width: this.SECOND_PART, height: this.height, topMargin: 13, text: this.scale.toString(), - alpha: 0.0, + backgroundAlpha: 0.0, visible: editToolsOn, color: activeUIColor }); @@ -126,7 +126,7 @@ function ScaleSelector() { width: this.SECOND_PART, height: this.height, leftMargin: 28, text: this.power.toString(), - alpha: 0.0, + backgroundAlpha: 0.0, visible: false, color: activeUIColor }); diff --git a/examples/growTrees.js b/examples/growTrees.js index 13d6cdc587..a5b55eecd6 100644 --- a/examples/growTrees.js +++ b/examples/growTrees.js @@ -116,7 +116,7 @@ function ScaleSelector() { width: this.SECOND_PART, height: this.height, topMargin: 13, text: this.scale.toString(), - alpha: 0.0, + backgroundAlpha: 0.0, visible: editToolsOn, color: activeUIColor }); @@ -125,7 +125,7 @@ function ScaleSelector() { width: this.SECOND_PART, height: this.height, leftMargin: 28, text: this.power.toString(), - alpha: 0.0, + backgroundAlpha: 0.0, visible: false, color: activeUIColor }); diff --git a/examples/libraries/ExportMenu.js b/examples/libraries/ExportMenu.js index 0a47f2bd69..247391808f 100644 --- a/examples/libraries/ExportMenu.js +++ b/examples/libraries/ExportMenu.js @@ -81,7 +81,7 @@ ExportMenu = function (opts) { y: pos.y + margin, width: scaleViewWidth, height: height, - alpha: 0.0, + backgroundAlpha: 0.0, color: { red: 255, green: 255, blue: 255 }, text: "1" }); diff --git a/examples/libraries/ToolTip.js b/examples/libraries/ToolTip.js index 785a0e4d2f..590eba36d0 100644 --- a/examples/libraries/ToolTip.js +++ b/examples/libraries/ToolTip.js @@ -26,6 +26,7 @@ function Tooltip() { text: "", color: { red: 128, green: 128, blue: 128 }, alpha: 0.2, + backgroundAlpha: 0.2, visible: false }); this.show = function (doShow) { diff --git a/examples/libraries/entityCameraTool.js b/examples/libraries/entityCameraTool.js index 3cd2b8a97e..803a58f48e 100644 --- a/examples/libraries/entityCameraTool.js +++ b/examples/libraries/entityCameraTool.js @@ -390,6 +390,7 @@ var ZoomTool = function(opts) { leftMargin: 4, text: "+", alpha: 1.0, + backgroundAlpha: 1.0, visible: true, }); var decreaseButton = Overlays.addOverlay("text", { @@ -403,6 +404,7 @@ var ZoomTool = function(opts) { leftMargin: 4, text: "-", alpha: 1.0, + backgroundAlpha: 1.0, visible: true, }); var zoomBar = Overlays.addOverlay("text", { @@ -416,6 +418,7 @@ var ZoomTool = function(opts) { leftMargin: 4, text: "", alpha: 1.0, + backgroundAlpha: 1.0, visible: true, }); var zoomHandle = Overlays.addOverlay("text", { @@ -428,6 +431,7 @@ var ZoomTool = function(opts) { leftMargin: 4, text: "", alpha: 1.0, + backgroundAlpha: 1.0, visible: true, }); @@ -501,6 +505,7 @@ var ArrowTool = function(opts) { leftMargin: 4, text: "^", alpha: 1.0, + backgroundAlpha: 1.0, visible: true, }); var leftButton = Overlays.addOverlay("text", { @@ -514,6 +519,7 @@ var ArrowTool = function(opts) { leftMargin: 4, text: "<", alpha: 1.0, + backgroundAlpha: 1.0, visible: true, }); var rightButton = Overlays.addOverlay("text", { @@ -540,6 +546,7 @@ var ArrowTool = function(opts) { leftMargin: 4, text: "v", alpha: 1.0, + backgroundAlpha: 1.0, visible: true, }); var centerButton = Overlays.addOverlay("text", { @@ -553,6 +560,7 @@ var ArrowTool = function(opts) { leftMargin: 4, text: "", alpha: 1.0, + backgroundAlpha: 1.0, visible: true, }); diff --git a/examples/libraries/entitySelectionTool.js b/examples/libraries/entitySelectionTool.js index fa97e9351f..c05ccbcef5 100644 --- a/examples/libraries/entitySelectionTool.js +++ b/examples/libraries/entitySelectionTool.js @@ -368,6 +368,7 @@ SelectionDisplay = (function () { color: { red: 0, green: 0, blue: 0}, backgroundColor: { red: 255, green: 255, blue: 255 }, alpha: 0.7, + backgroundAlpha: 0.7, visible: false, isFacingAvatar: true, drawInFront: true, diff --git a/examples/libraries/progressDialog.js b/examples/libraries/progressDialog.js index dff0904372..7d3b1f88e2 100644 --- a/examples/libraries/progressDialog.js +++ b/examples/libraries/progressDialog.js @@ -40,6 +40,7 @@ progressDialog = (function () { textColor: textColor, backgroundColor: textBackground, alpha: 0.9, + backgroundAlpha: 0.9, visible: false }); @@ -50,6 +51,7 @@ progressDialog = (function () { textColor: textColor, backgroundColor: textBackground, alpha: 0.9, + backgroundAlpha: 0.9, visible: false }); diff --git a/examples/libraries/toolBars.js b/examples/libraries/toolBars.js index dc17f02869..5802625d7b 100644 --- a/examples/libraries/toolBars.js +++ b/examples/libraries/toolBars.js @@ -138,6 +138,7 @@ ToolBar = function(x, y, direction) { width: this.width, height: this.height, alpha: 1.0, + backgroundAlpha: 1.0, visible: false }); this.spacing = []; @@ -243,7 +244,10 @@ ToolBar = function(x, y, direction) { this.tools[tool].setAlpha(alpha); } if (this.back != null) { - Overlays.editOverlay(this.back, { alpha: alpha}); + Overlays.editOverlay(this.back, { + alpha: alpha, + backgroundAlpha: alpha + }); } } else { this.tools[tool].setAlpha(alpha); @@ -263,7 +267,7 @@ ToolBar = function(x, y, direction) { ((direction == ToolBar.VERTICAL) ? 1 : 2) * ToolBar.SPACING, visible: true, backgroundColor: color, - alpha: alpha + backgroundAlpha: alpha }); } } diff --git a/examples/lobby.js b/examples/lobby.js index 9e454eccc9..c5a9645e90 100644 --- a/examples/lobby.js +++ b/examples/lobby.js @@ -113,6 +113,7 @@ function drawLobby() { text: "", lineHeight: lineHeight, alpha: 0.9, + backgroundAlpha: 0.9, ignoreRayIntersection: true, visible: false, isFacingAvatar: true diff --git a/examples/newEditEntities.js b/examples/newEditEntities.js index 9bbb07651c..4abf56c8fd 100644 --- a/examples/newEditEntities.js +++ b/examples/newEditEntities.js @@ -145,6 +145,7 @@ var toolBar = (function () { topMargin: menuItemMargin, text: "Model URL", alpha: 0.9, + backgroundAlpha: 0.9, visible: false }); @@ -154,6 +155,7 @@ var toolBar = (function () { topMargin: menuItemMargin, text: "Model File", alpha: 0.9, + backgroundAlpha: 0.9, visible: false }); diff --git a/examples/notifications.js b/examples/notifications.js index 16e9dd70b2..2c2c4a5c0b 100644 --- a/examples/notifications.js +++ b/examples/notifications.js @@ -115,6 +115,7 @@ function createNotification(text) { color: textColor, backgroundColor: backColor, alpha: backgroundAlpha, + backgroundAlpha: backgroundAlpha, topMargin: topMargin, leftMargin: leftMargin, font: {size: fontSize}, @@ -160,7 +161,7 @@ function fadeIn(noticeIn, buttonIn) { pauseTimer = Script.setInterval(function() { q++; qFade = q / 10.0; - Overlays.editOverlay(noticeIn, {alpha: qFade}); + Overlays.editOverlay(noticeIn, {alpha: qFade, backgroundAlpha: qFade}); Overlays.editOverlay(buttonIn, {alpha: qFade}); if (q >= 9.0) { Script.clearInterval(pauseTimer); @@ -344,7 +345,7 @@ function fadeOut(noticeOut, buttonOut, arraysOut) { pauseTimer = Script.setInterval(function() { r--; rFade = r / 10.0; - Overlays.editOverlay(noticeOut, {alpha: rFade}); + Overlays.editOverlay(noticeOut, {alpha: rFade, backgroundAlpha: rFade}); Overlays.editOverlay(buttonOut, {alpha: rFade}); if (r < 0) { dismiss(noticeOut, buttonOut, arraysOut); diff --git a/examples/testModelOverlaySubMeshes.js b/examples/testModelOverlaySubMeshes.js index 5195b76e60..20ec10ef7c 100644 --- a/examples/testModelOverlaySubMeshes.js +++ b/examples/testModelOverlaySubMeshes.js @@ -57,6 +57,7 @@ var statusText = Overlays.addOverlay("text", { height: 20, backgroundColor: { red: 0, green: 0, blue: 0}, alpha: 1.0, + backgroundAlpha: 1.0, color: { red: 255, green: 255, blue: 255}, topMargin: 4, leftMargin: 4, diff --git a/examples/textInputOverlayExample.js b/examples/textInputOverlayExample.js index e837e81eb5..8a5fad81cd 100644 --- a/examples/textInputOverlayExample.js +++ b/examples/textInputOverlayExample.js @@ -44,6 +44,7 @@ var inputWindow = Overlays.addOverlay("text", { color: textColor, backgroundColor: backColor, alpha: backgroundAlpha, + backgroundAlpha: backgroundAlpha, topMargin: topMargin, leftMargin: leftMargin, font: {size: fontSize},