mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-30 14:22:56 +02:00
Remove background image
This commit is contained in:
parent
0824142987
commit
c9e4fddeab
2 changed files with 3 additions and 36 deletions
|
@ -1,5 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="520" height="50" viewBox="0 0 520.00 50.00" enable-background="new 0 0 540.00 50.00" xml:space="preserve">
|
|
||||||
<rect x="0" y="0" rx="8" ry="8" width="520" height="50" style="fille:black;opacity:0.6" />
|
|
||||||
</svg>
|
|
|
@ -38,13 +38,9 @@
|
||||||
TEXT_HEIGHT = 32,
|
TEXT_HEIGHT = 32,
|
||||||
TEXT_WIDTH = 256,
|
TEXT_WIDTH = 256,
|
||||||
TEXT_URL = Script.resolvePath("assets/images/progress-bar-text.svg"),
|
TEXT_URL = Script.resolvePath("assets/images/progress-bar-text.svg"),
|
||||||
BACKGROUND_WIDTH = 520,
|
|
||||||
BACKGROUND_HEIGHT = 50,
|
|
||||||
BACKGROUND_URL = Script.resolvePath("assets/images/progress-bar-background.svg"),
|
|
||||||
windowWidth = 0,
|
windowWidth = 0,
|
||||||
windowHeight = 0,
|
windowHeight = 0,
|
||||||
bar2D = {},
|
bar2D = {},
|
||||||
background2D = {},
|
|
||||||
textDesktop = {}, // Separate desktop and HMD overlays because can't change text size after overlay created.
|
textDesktop = {}, // Separate desktop and HMD overlays because can't change text size after overlay created.
|
||||||
textHMD = {},
|
textHMD = {},
|
||||||
SCALE_2D = 0.35, // Scale the SVGs for 2D display.
|
SCALE_2D = 0.35, // Scale the SVGs for 2D display.
|
||||||
|
@ -92,10 +88,6 @@
|
||||||
visible = false;
|
visible = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Overlays.editOverlay(background2D.overlay, {
|
|
||||||
alpha: alpha,
|
|
||||||
visible: visible
|
|
||||||
});
|
|
||||||
Overlays.editOverlay(bar2D.overlay, {
|
Overlays.editOverlay(bar2D.overlay, {
|
||||||
alpha: alpha,
|
alpha: alpha,
|
||||||
visible: visible
|
visible: visible
|
||||||
|
@ -152,13 +144,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function createOverlays() {
|
function createOverlays() {
|
||||||
background2D.overlay = Overlays.addOverlay("image", {
|
|
||||||
imageURL: BACKGROUND_URL,
|
|
||||||
width: background2D.width,
|
|
||||||
height: background2D.height,
|
|
||||||
visible: false,
|
|
||||||
alpha: 0.0
|
|
||||||
});
|
|
||||||
bar2D.overlay = Overlays.addOverlay("image", {
|
bar2D.overlay = Overlays.addOverlay("image", {
|
||||||
imageURL: BAR_URL,
|
imageURL: BAR_URL,
|
||||||
subImage: {
|
subImage: {
|
||||||
|
@ -189,8 +174,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function deleteOverlays() {
|
function deleteOverlays() {
|
||||||
Overlays.deleteOverlay(background2D.overlay);
|
|
||||||
Overlays.deleteOverlay(bar2D.overlay);
|
Overlays.deleteOverlay(bar2D.overlay);
|
||||||
|
Overlays.deleteOverlay(textDesktop.overlay);
|
||||||
|
Overlays.deleteOverlay(textHMD.overlay);
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateProgressBarLocation() {
|
function updateProgressBarLocation() {
|
||||||
|
@ -202,14 +188,9 @@
|
||||||
isHMD = HMD.active;
|
isHMD = HMD.active;
|
||||||
yOffset = isHMD ? BAR_Y_OFFSET_HMD : BAR_Y_OFFSET_2D;
|
yOffset = isHMD ? BAR_Y_OFFSET_HMD : BAR_Y_OFFSET_2D;
|
||||||
|
|
||||||
Overlays.editOverlay(background2D.overlay, {
|
|
||||||
x: windowWidth / 2 - background2D.width / 2,
|
|
||||||
y: windowHeight - background2D.height - bar2D.height + yOffset
|
|
||||||
});
|
|
||||||
|
|
||||||
Overlays.editOverlay(bar2D.overlay, {
|
Overlays.editOverlay(bar2D.overlay, {
|
||||||
x: windowWidth / 2 - bar2D.width / 2,
|
x: windowWidth / 2 - bar2D.width / 2,
|
||||||
y: windowHeight - background2D.height - bar2D.height + (background2D.height - bar2D.height) / 2 + yOffset
|
y: windowHeight - 2 * bar2D.height + yOffset
|
||||||
});
|
});
|
||||||
|
|
||||||
Overlays.editOverlay(textDesktop.overlay, {
|
Overlays.editOverlay(textDesktop.overlay, {
|
||||||
|
@ -276,9 +257,6 @@
|
||||||
Overlays.editOverlay(bar2D.overlay, {
|
Overlays.editOverlay(bar2D.overlay, {
|
||||||
visible: true,
|
visible: true,
|
||||||
subImage: {
|
subImage: {
|
||||||
|
|
||||||
// $$$$$$$
|
|
||||||
|
|
||||||
x: BAR_WIDTH * (1 - displayProgress / 100),
|
x: BAR_WIDTH * (1 - displayProgress / 100),
|
||||||
y: 0,
|
y: 0,
|
||||||
width: BAR_WIDTH,
|
width: BAR_WIDTH,
|
||||||
|
@ -286,10 +264,6 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Overlays.editOverlay(background2D.overlay, {
|
|
||||||
visible: true
|
|
||||||
});
|
|
||||||
|
|
||||||
Overlays.editOverlay(textDesktop.overlay, {
|
Overlays.editOverlay(textDesktop.overlay, {
|
||||||
visible: !isHMD
|
visible: !isHMD
|
||||||
});
|
});
|
||||||
|
@ -310,8 +284,6 @@
|
||||||
function setUp() {
|
function setUp() {
|
||||||
isHMD = HMD.active;
|
isHMD = HMD.active;
|
||||||
|
|
||||||
background2D.width = SCALE_2D * BACKGROUND_WIDTH;
|
|
||||||
background2D.height = SCALE_2D * BACKGROUND_HEIGHT;
|
|
||||||
bar2D.width = SCALE_2D * BAR_WIDTH;
|
bar2D.width = SCALE_2D * BAR_WIDTH;
|
||||||
bar2D.height = SCALE_2D * BAR_HEIGHT;
|
bar2D.height = SCALE_2D * BAR_HEIGHT;
|
||||||
textDesktop.width = SCALE_TEXT_DESKTOP * TEXT_WIDTH;
|
textDesktop.width = SCALE_TEXT_DESKTOP * TEXT_WIDTH;
|
||||||
|
|
Loading…
Reference in a new issue