mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-05 21:22:07 +02:00
adding fade in and fade outt in interstitial for progress
This commit is contained in:
parent
fd3c0d2f76
commit
6cf9608c97
2 changed files with 15 additions and 7 deletions
|
@ -381,8 +381,8 @@
|
|||
|
||||
function updateOverlays(physicsEnabled) {
|
||||
|
||||
if (isInterstitialOverlaysVisible !== !physicsEnabled) {
|
||||
// visible changed
|
||||
if (isInterstitialOverlaysVisible !== !physicsEnabled && !physicsEnabled === true) {
|
||||
// visible changed to true.
|
||||
isInterstitialOverlaysVisible = !physicsEnabled;
|
||||
}
|
||||
|
||||
|
@ -432,6 +432,11 @@
|
|||
if (physicsEnabled) {
|
||||
Camera.mode = previousCameraMode;
|
||||
}
|
||||
|
||||
if (isInterstitialOverlaysVisible !== !physicsEnabled && !physicsEnabled === false) {
|
||||
// visible changed to false.
|
||||
isInterstitialOverlaysVisible = !physicsEnabled;
|
||||
}
|
||||
}
|
||||
|
||||
function scaleInterstitialPage(sensorToWorldScale) {
|
||||
|
|
|
@ -267,7 +267,7 @@
|
|||
|
||||
// Update state
|
||||
if (!visible) { // Not visible because no recent downloads
|
||||
if ((displayProgress < 100 || gpuTextures > 0) && !(isInInterstitialMode || isInterstitialOverlaysVisible)) { // Have started downloading so fade in
|
||||
if ((displayProgress < 100 || gpuTextures > 0) && !isInInterstitialMode && !isInterstitialOverlaysVisible) { // Have started downloading so fade in
|
||||
visible = true;
|
||||
alphaDelta = ALPHA_DELTA_IN;
|
||||
fadeTimer = Script.setInterval(fade, FADE_INTERVAL);
|
||||
|
@ -307,10 +307,13 @@
|
|||
} else {
|
||||
x = x * BAR_HMD_REPEAT;
|
||||
}
|
||||
if (isInInterstitialMode || isInterstitialOverlaysVisible) {
|
||||
visible = false;
|
||||
}
|
||||
|
||||
// Update progress bar
|
||||
Overlays.editOverlay(barDesktop.overlay, {
|
||||
visible: !isHMD,
|
||||
visible: !isHMD && visible,
|
||||
bounds: {
|
||||
x: barDesktop.repeat - x,
|
||||
y: windowHeight - barDesktop.height,
|
||||
|
@ -320,7 +323,7 @@
|
|||
});
|
||||
|
||||
Overlays.editOverlay(barHMD.overlay, {
|
||||
visible: isHMD,
|
||||
visible: isHMD && visible,
|
||||
bounds: {
|
||||
x: BAR_HMD_REPEAT - x,
|
||||
y: windowHeight - BAR_HMD_HEIGHT,
|
||||
|
@ -330,11 +333,11 @@
|
|||
});
|
||||
|
||||
Overlays.editOverlay(textDesktop.overlay, {
|
||||
visible: !isHMD
|
||||
visible: !isHMD && visible
|
||||
});
|
||||
|
||||
Overlays.editOverlay(textHMD.overlay, {
|
||||
visible: isHMD
|
||||
visible: isHMD && visible
|
||||
});
|
||||
|
||||
// Update 2D overlays to maintain positions at bottom middle of window
|
||||
|
|
Loading…
Reference in a new issue