/// <summary> /// This is called when the game should draw itself. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Draw(GameTime gameTime) { KeyboardHandler(); _isDrawing.WaitOne(); WindowHeight = Window.ClientBounds.Height; WindowWidth = Window.ClientBounds.Width; if (ServDialog == null) ServDialog = new ServerDialog(this); ClickableList = new Dictionary<Rectangle, IClickable>(); GraphicsDevice.Clear(_bgColour); SpriteBatch.Begin(); DrawMouse(); DrawAnnouncement(); DrawGameAnnouncement(); DrawDrawables(); switch (GameState) { case -2: DrawString("Waiting for the server to start game!",(int)(this.Window.ClientBounds.Width/2-Sf.MeasureString("Waiting for the server to start game!").X/2),this.Window.ClientBounds.Height/2,0f,1f); break; case -1: DrawString("Waiting for player list", (int)(this.Window.ClientBounds.Width / 2 - Sf.MeasureString("Waiting For Game to Start").X/2), this.Window.ClientBounds.Height, 0f, 1f); break; case 0: ServDialog.Draw(); break; case 1: DrawTopCard(); break; case 2: DrawTopCard(); DrawMouseoverCard(); break; case 3: DrawString("Target a player!", Window.ClientBounds.Width/2 - 90, Window.ClientBounds.Height/2, 0f, 1.5f); break; case 4: DrawTimedForm(); break; } //if (TimedDialog != null && TimedDialog.IsActive) //TimedDialog.Draw(); for( int i = 0; i < AnimationList.Count; i++ ) { AnimationList[i].Draw(); if (AnimationList[i].Finished) AnimationList.RemoveAt(i); } SpriteBatch.End(); _isDrawing.ReleaseMutex(); base.Draw(gameTime); }
public StartButton(int x, int y, int width, int height, float scale, string text, TwoClient twoClient, SpriteFont font, Texture2D butTexture, ServerDialog serverDialog) : base(x, y, width, height, scale, text, twoClient, font, butTexture) { _serverDialog = serverDialog; }