private void ShowMouse() { MouseState msta = Mouse.GetState(); if (msta.X > this.recViewport.X && msta.X < this.recViewport.X + this.recViewport.Width && msta.Y > this.recViewport.Y && msta.Y < this.recViewport.Y + this.recViewport.Height) { //SpriteBatchDraw(dicTextures["cursor_bc"], new Vector2(msta.X, msta.Y), 1f); SpriteBatchDraw(dicTextures["cursor_cross"], new Vector2(msta.X - 3, msta.Y - 3), 1f); InfoForm.SetMonPos(msta.X, msta.Y); string strAdr = this.InfoForm.kod.intHexX.ToString("00") + this.InfoForm.kod.intHexY.ToString("00"); //InfoForm.txtYDiff.Text = strAdr; if (dicHex.ContainsKey(strAdr)) { clsHexFeld hex = dicHex[strAdr]; SpriteBatchDraw(dicTextures["hex_rot"], new Vector2(hex.kod.intXmon, hex.kod.intYmon), 2f); } else { string str = strAdr; } } }
/// <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) { GraphicsDevice.Clear(Color.Beige); // TODO: Add your drawing code here spriteBatch.Begin(/*SpriteBlendMode.AlphaBlend*/); spriteBatch.Draw(this.texBackground, this.recViewport, Color.White); string strAdr = this.Calculator.kod.intHexX.ToString("00") + this.Calculator.kod.intHexY.ToString("00"); if (dicHex.ContainsKey(strAdr)) { clsHexFeld hex = dicHex[strAdr]; SpriteBatchDraw(dicTextures["hex_blau"], new Vector2(hex.kod.intXmon, hex.kod.intYmon), 1f); } BuildHexMap("hex3"); ShowMouse(); spriteBatch.End(); base.Draw(gameTime); if (!InfoForm.Visible) { InfoForm.Show(); } }