Browse Source

Switch to alpha

pull/2/head
Robert Chen 11 years ago
parent
commit
5d9373e688
  1. 6
      js/main.js
  2. 2
      js/screens.js
  3. 27
      js/ui.js
  4. BIN
      res/screens/KitchenScreen/Cookbook-Open.png

6
js/main.js

@ -353,10 +353,10 @@ function GameUI( canvasElem, gameState ){ @@ -353,10 +353,10 @@ function GameUI( canvasElem, gameState ){
var soundManager = new SoundManager( gameState );
this.activeScreenObj = new LoadingScreen( this.stage, gameState );
var textContent = new createjs.Text( "", "20px Arial", "black" );
var textContent = new createjs.Text( "", "20px Arial", "white" );
textContent.x = 750;
textContent.y = 30;
//this.stage.addChild( textContent);
this.stage.addChild( textContent);
var overlay = new createjs.Shape();
overlay.graphics.beginFill("#fffffff").drawRect(0, 0, 800, 600 );
overlay.alpha = 0;
@ -374,7 +374,7 @@ function GameUI( canvasElem, gameState ){ @@ -374,7 +374,7 @@ function GameUI( canvasElem, gameState ){
this.actuallySwitchScreen = function( screenName ){
that.stage.removeAllChildren();
that.activeScreenObj = new that.screens[ screenName ]( that.stage, gameState );
//that.stage.addChild( textContent );
that.stage.addChild( textContent );
that.stage.addChild( overlay );
dialogManager.render();
};

2
js/screens.js

@ -628,8 +628,6 @@ function ScoreScreen( stage, gameState ){ @@ -628,8 +628,6 @@ function ScoreScreen( stage, gameState ){
stage.addChild( turkeyTypeModifierText );
stage.addChild( frillsModifierText );
stage.addChild( hardcoreModifierText );
}} );

27
js/ui.js

@ -720,14 +720,14 @@ function WindowUI( stage, gameState ){ @@ -720,14 +720,14 @@ function WindowUI( stage, gameState ){
stage.addChild( mood );
for( var i in smallWindows ){
smallWindows[i].alpha = UtilityFunctions.randRange(0,1);
streetLight.alpha = 1;
smallWindows[i].visible = UtilityFunctions.randRange(0,1);
streetLight.visible = 1;
stage.addChild( smallWindows[i] );
}
for( var i in windows ){
windows[i].alpha = UtilityFunctions.randRange(0,1);
streetLight.alpha = 1;
windows[i].visible = UtilityFunctions.randRange(0,1);
streetLight.visible = 1;
stage.addChild( windows[i] );
}
stage.addChild( streetLight );
@ -749,35 +749,34 @@ return { @@ -749,35 +749,34 @@ return {
// turn on lights
if( dayNight.x < 0 && dayNight.x > -4545 ){
for( var i in smallWindows ){
smallWindows[i].alpha = UtilityFunctions.randRange(0,1);
smallWindows[i].visible = UtilityFunctions.randRange(0,1);
}
for( var i in windows ){
windows[i].alpha = UtilityFunctions.randRange(0,1);
windows[i].visible = UtilityFunctions.randRange(0,1);
}
// turn on random window lights
streetLight.alpha = 1;
streetLight.visible = 1;
}
else if( dayNight.x < -11687 ){
for( var i in smallWindows ){
smallWindows[i].alpha = UtilityFunctions.randRange(0,1);
smallWindows[i].visible = UtilityFunctions.randRange(0,1);
}
for( var i in windows ){
windows[i].alpha = UtilityFunctions.randRange(0,1);
windows[i].visible = UtilityFunctions.randRange(0,1);
}
streetLight.alpha = 1;
streetLight.visible = 1;
}
// daytime, turn off all lights
else{
for( var i in smallWindows ){
smallWindows[i].alpha = 0;
smallWindows[i].visible = 0;
}
for( var i in windows ){
windows[i].alpha = 0;
windows[i].visible = 0;
}
streetLight.alpha = 0;
streetLight.visible = 0;
}
}
if( dayNight.x < -15583 )

BIN
res/screens/KitchenScreen/Cookbook-Open.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 333 KiB

After

Width:  |  Height:  |  Size: 293 KiB

Loading…
Cancel
Save