public ScreenEngine(GameEngine game, string fileName) { this.game = game; this.Content = new ContentManager(game.Services, GameEngine.ContentRootDirectory); this.FileName = fileName; this.CurrentEvents = new Dictionary <string, bool>(); this.tapAreas = new List <XTapArea>(); this.obstacles = new List <XElement>(); this.spriteBatch = new SpriteBatchWithFloats(this.game.GraphicsDevice); if (this.game.Scale != Vector3.One) { scaleMatrix = Matrix.CreateScale(this.game.Scale); } this.initializeParameters = new InitializeParameters() { Game = game, ScreenEngine = this }; this.updateParameters = new UpdateParameters() { Game = game, ScreenEngine = this }; this.drawParameters = new DrawParameters() { Game = game, ScreenEngine = this, SpriteBatch = spriteBatch }; }
public override void Draw(DrawParameters p) { base.Draw(p); if (Radius > GameEngine.MaxWaveTravelDistance) return; if (this.IsHeroActive) p.SpriteBatch.Draw(texture.Image, bounds, texture.SourceRectangle, Color.White); else p.SpriteBatch.Draw(texture.Image, bounds, texture.SourceRectangle, Color.Gray); }
public void DrawDebugInfo(DrawParameters dp) { fpsSw.Stop(); if (fpsSw.Elapsed.TotalMilliseconds > 0) { fps = fps * 0.9 + (1000.0 / fpsSw.Elapsed.TotalMilliseconds) * 0.1; } fpsSw.Reset(); fpsSw.Start(); dp.SpriteBatch.DrawString(game.SystemFont, Math.Round(fps).ToString(), fpsPos, Color.Red); }
public override void Draw(DrawParameters p) { base.Draw(p); if (Radius > GameEngine.MaxWaveTravelDistance) { return; } if (this.IsHeroActive) { p.SpriteBatch.Draw(texture.Image, bounds, texture.SourceRectangle, Color.White); } else { p.SpriteBatch.Draw(texture.Image, bounds, texture.SourceRectangle, Color.Gray); } }
public override void Draw(DrawParameters p) { if (this.isTriggered) base.Draw(p); }
public void DrawDebug(DrawParameters p) { if (!(this is XImage) && !(this is XBlock)) return; tmpBounds = this.GetScreenBounds(); #if WINDOWS tmpVector1 = MouseProcessor.LastPosition; #else tmpVector1 = TouchPanelProcessor.LastPosition; #endif if (!tmpBounds.Contains((int)tmpVector1.X, (int)tmpVector1.Y)) return; Color c = Color.Red * 0.3f; p.SpriteBatch.Draw(p.Game.BlankTexture, tmpBounds, c); if (!string.IsNullOrEmpty(this.Id)) { tmpVector1.X = tmpBounds.X; tmpVector1.Y = tmpBounds.Y; p.SpriteBatch.DrawString(p.Game.SystemFont, this.Id, tmpVector1, Color.Yellow); } }
public override void Draw(DrawParameters p) { base.Draw(p); if (p.Game.GameObject.ShowDebugInfo && p.Game.DrawDebugInfo) { DrawDebug(p); } }