Ejemplo n.º 1
0
        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
            };
        }
Ejemplo n.º 2
0
		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);
		}
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        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);
            }
        }
Ejemplo n.º 5
0
		public override void Draw(DrawParameters p)
		{
			if (this.isTriggered)
				base.Draw(p);
		}
Ejemplo n.º 6
0
		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);
			}
		}
Ejemplo n.º 7
0
		public override void Draw(DrawParameters p)
		{
			base.Draw(p);

            if (p.Game.GameObject.ShowDebugInfo && p.Game.DrawDebugInfo)
            {
                DrawDebug(p);
            }
        }