protected override void Update(GameTime gameTime)
{
double elapsed = gameTime.ElapsedGameTime.TotalSeconds;
double fps = 1.0 / elapsed;
_deltaFPS += gameTime.ElapsedGameTime.TotalSeconds;
if (_deltaFPS > 1) {
_deltaFPS -= 1;
MainForm.Text = "GameLab (" + fps + ")";
}
_engine.Update(gameTime);
Form1 form = MainForm as Form1;
/*Vector2 offset = new Vector2(-form.CanvasHScroll.Value * _zoom, -form.CanvasVScroll.Value * _zoom);
if (this.Width > map.PixelsWide * _zoom) {
offset.X = (this.Width - map.PixelsWide * _zoom) / 2;
}
if (this.Height > map.PixelsHigh * _zoom) {
offset.Y = (this.Height - map.PixelsHigh * _zoom) / 2;
}
int tx = (int)Math.Floor(((float)mousex - offset.X) / (map.TileWidth * _zoom));
int ty = (int)Math.Floor(((float)mousey - offset.Y) / (map.TileHeight * _zoom));
if (!_hover || tx < 0 || ty < 0 || tx >= map.TilesWide || ty >= map.TilesHigh) {
form.StatusCoord.Text = "";
}
else {
form.StatusCoord.Text = tx + ", " + ty;
}
form.Label.Text = " HV: " + form.CanvasHScroll.Value + ", " + form.CanvasVScroll.Value;
form.Label.Text += " CSZ: " + Width + ", " + Height;
form.Label.Text += " MSZ: " + map.PixelsWide + ", " + map.PixelsHigh;
form.Label.Text += " DF: " + (map.PixelsWide - Width) + ", " + (map.PixelsHigh - Height);
form.Label.Text += " HVS: " + form.CanvasHScroll.Maximum + ", " + form.CanvasVScroll.Maximum;*/
}