|
|
|
@ -15,12 +15,29 @@ public class Scenes
|
|
|
|
|
private List<Button> Buttons;
|
|
|
|
|
public bool wait;
|
|
|
|
|
private bool mwait;
|
|
|
|
|
private RenderTarget2D blackborder;
|
|
|
|
|
public Scenes(Game1 Game, SpriteBatch _spriteBatch)
|
|
|
|
|
{
|
|
|
|
|
GU = GU = new gameui(Game.Content.Load<Texture2D>("background"), Game.PL);
|
|
|
|
|
this._spriteBatch = _spriteBatch;
|
|
|
|
|
this.Game = Game;
|
|
|
|
|
Buttons = new List<Button>();
|
|
|
|
|
blackborder = new RenderTarget2D(_spriteBatch.GraphicsDevice, (int)vars.ScreenSize.X, (int)vars.ScreenSize.Y);
|
|
|
|
|
Rectangle[] box = new Rectangle[]{
|
|
|
|
|
new Rectangle(0, 0, (int)vars.ScreenSize.X, vars.PlayArea.Y),
|
|
|
|
|
new Rectangle(0, 0, vars.PlayArea.X, (int)vars.ScreenSize.Y),
|
|
|
|
|
new Rectangle(0, vars.PlayArea.Bottom, (int)vars.ScreenSize.X, (int)vars.ScreenSize.Y-vars.PlayArea.Bottom),
|
|
|
|
|
new Rectangle(vars.PlayArea.Right, 0, (int)vars.ScreenSize.X-vars.PlayArea.Right, (int)vars.ScreenSize.Y),
|
|
|
|
|
};
|
|
|
|
|
_spriteBatch.GraphicsDevice.SetRenderTarget(blackborder);
|
|
|
|
|
_spriteBatch.GraphicsDevice.Clear(Color.Transparent);
|
|
|
|
|
_spriteBatch.Begin();
|
|
|
|
|
foreach(var item in box)
|
|
|
|
|
{
|
|
|
|
|
_spriteBatch.Draw(vars.ThePixel, item, null, Color.Black);
|
|
|
|
|
}
|
|
|
|
|
_spriteBatch.End();
|
|
|
|
|
_spriteBatch.GraphicsDevice.SetRenderTarget(null);
|
|
|
|
|
initscenes();
|
|
|
|
|
}
|
|
|
|
|
public void draw(GameTime gameTime)
|
|
|
|
@ -111,8 +128,8 @@ public class Scenes
|
|
|
|
|
GU.draw(_spriteBatch);
|
|
|
|
|
Game.PL.Draw(_spriteBatch, gameTime);
|
|
|
|
|
Game.AS.Draw(_spriteBatch, gameTime);
|
|
|
|
|
_spriteBatch.Draw(vars.ThePixel, new Rectangle(vars.PlayArea.X, vars.PlayArea.Bottom, vars.PlayArea.Width, (int)vars.ScreenSize.Y - vars.PlayArea.Bottom), null, Color.Black);
|
|
|
|
|
_spriteBatch.Draw(vars.ThePixel, new Rectangle(vars.PlayArea.X, 0, vars.PlayArea.Width, vars.PlayArea.Y), null, Color.Black);
|
|
|
|
|
_spriteBatch.Draw(blackborder, Vector2.Zero, null, Color.White);
|
|
|
|
|
GU.draw(_spriteBatch);
|
|
|
|
|
_spriteBatch.End();
|
|
|
|
|
}
|
|
|
|
|
public void U1(GameTime gameTime)
|
|
|
|
@ -138,8 +155,8 @@ public class Scenes
|
|
|
|
|
item.draw(_spriteBatch);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
_spriteBatch.Draw(vars.ThePixel, new Rectangle(vars.PlayArea.X, vars.PlayArea.Bottom, vars.PlayArea.Width, (int)vars.ScreenSize.Y - vars.PlayArea.Bottom), null, Color.Black);
|
|
|
|
|
_spriteBatch.Draw(vars.ThePixel, new Rectangle(vars.PlayArea.X, 0, vars.PlayArea.Width, vars.PlayArea.Y), null, Color.Black);
|
|
|
|
|
_spriteBatch.Draw(blackborder, Vector2.Zero, null, Color.White);
|
|
|
|
|
GU.draw(_spriteBatch);
|
|
|
|
|
_spriteBatch.End();
|
|
|
|
|
}
|
|
|
|
|
public void U2()
|
|
|
|
@ -182,6 +199,7 @@ public class gameui
|
|
|
|
|
public Texture2D Background;
|
|
|
|
|
private float bgY;
|
|
|
|
|
private Player PL;
|
|
|
|
|
private int layer;
|
|
|
|
|
public gameui(Texture2D bg, Player PL)
|
|
|
|
|
{
|
|
|
|
|
this.Background = bg;
|
|
|
|
@ -203,8 +221,13 @@ public class gameui
|
|
|
|
|
bgY = vars.PlayArea.Y;
|
|
|
|
|
}
|
|
|
|
|
//the boxes
|
|
|
|
|
_spriteBatch.Draw(Background, new Rectangle(vars.PlayArea.X, (int)bgY, vars.PlayArea.Width, vars.PlayArea.Height), null, Color.White);
|
|
|
|
|
_spriteBatch.Draw(Background, new Rectangle(vars.PlayArea.X, (int)bgY - vars.PlayArea.Height, vars.PlayArea.Width, vars.PlayArea.Height), null, Color.White);
|
|
|
|
|
if(layer == 0)
|
|
|
|
|
{
|
|
|
|
|
_spriteBatch.Draw(Background, new Rectangle(vars.PlayArea.X, (int)bgY, vars.PlayArea.Width, vars.PlayArea.Height), null, Color.White, 0f, Vector2.Zero, SpriteEffects.None, 0);
|
|
|
|
|
_spriteBatch.Draw(Background, new Rectangle(vars.PlayArea.X, (int)bgY - vars.PlayArea.Height, vars.PlayArea.Width, vars.PlayArea.Height), null, Color.White, 0f, Vector2.Zero, SpriteEffects.None, 0);
|
|
|
|
|
layer++;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
_spriteBatch.Draw(vars.ThePixel, new Rectangle(50, 50, vars.PlayArea.X - 100, (int)vars.ScreenSize.Y - 100), null, new Color(dimnes, dimnes, dimnes));
|
|
|
|
|
Rectangle rightbox = new Rectangle(vars.PlayArea.Right + 50, 50, (int)vars.ScreenSize.X - vars.PlayArea.Right - 100, (int)vars.ScreenSize.Y - 100);
|
|
|
|
|
_spriteBatch.Draw(vars.ThePixel, rightbox, null, new Color(dimnes, dimnes, dimnes));
|
|
|
|
@ -247,5 +270,6 @@ public class gameui
|
|
|
|
|
_spriteBatch.DrawString(vars.Font, "Current Nr: " + AudioEn.cursong, new Vector2(musice.Center.X - vars.Font.MeasureString("Current Nr: " + AudioEn.cursong).X/2, musice.Center.Y - vars.Font.MeasureString("Current Nr: " + AudioEn.cursong).Y/2), Color.RoyalBlue);
|
|
|
|
|
string time = AudioEn.playedtime.ToString().Remove(0, 3).Remove(5) + " / " + AudioEn.songtime.ToString().Remove(0, 3).Remove(5);
|
|
|
|
|
_spriteBatch.DrawString(vars.Font, time, new Vector2(musice.Center.X - vars.Font.MeasureString(time).X/2, musice.Bottom-vars.Font.MeasureString(time).Y-25), Color.RoyalBlue);
|
|
|
|
|
layer = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|