Ejemplo n.º 1
0
        /// <summary>
        /// Draw the gris and its element
        /// </summary>
        /// <param name="spriteBatch"></param>
        public void Draw(SpriteBatchProxy spriteBatch)
        {
            foreach (Vector2 loc in _grid.Keys)
            {
                Tile tile = _grid[loc];

                if (Application.GameStateManager.CurrentGameState.SceneCamera.VisibilityRectangle.Intersects(tile.DestRect))
                {
                    if (String.IsNullOrEmpty(tile.Spritesheet))
                    {
                        spriteBatch.Draw(Application.MagicContentManager.EmptyTexture, tile.DestRect, tile.SourceRect, Color.Black);
                    }
                    else
                    {
                        spriteBatch.Draw(Application.MagicContentManager.GetTexture(tile.Spritesheet), tile.DestRect, tile.SourceRect, Color.White);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Display sprite on screen
        /// </summary>
        /// <param name="spriteBatch"></param>
        public virtual void Draw(SpriteBatchProxy spriteBatch)
        {
            if (IsOnScreen())
            {
                spriteBatch.Draw(Application.MagicContentManager.GetTexture(assetName), dRect, sRect, Color, (float)rotation, spriteOrigin, flip, 1.0f);

                if (Application.IsDebugMode)
                {
                    if (hitbox != null)
                    {
                        hitbox.Draw(spriteBatch);
                    }
                    if (awarenessbox != null)
                    {
                        awarenessbox.Draw(spriteBatch);
                    }
                }
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Affichage du nombre de FPS à l'écran et calcul du nombre d'affichages
        /// </summary>
        /// <param name="spriteBatch"></param>
        /// <param name="location"></param>
        public void Draw(SpriteBatchProxy spriteBatch, Vector2 location)
        {
            // On compte un affichage supplémentaire
            _totalFrames++;

            Color color = Color.Green;

#if !WINDOWS_PHONE
            if (_fps < 40)
            {
                color = Color.Coral;
            }
#endif

            if (_fps < 25)
            {
                color = Color.Red;
            }

            spriteBatch.DrawString(Application.MagicContentManager.Font, string.Format("FPS={0}", _fps), location, color);
        }
Ejemplo n.º 4
0
 public virtual void Draw(SpriteBatchProxy spriteBatch)
 {
     spriteBatch.Draw(Application.MagicContentManager.GetTexture("particules"), Location, src, color * alpha, rotation, particuleOrigin, scale, SpriteEffects.None, 1.0f);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Render the game state
 /// </summary>
 /// <param name="spriteBatch"></param>
 public override void Draw(SpriteBatchProxy spriteBatch)
 {
 }
Ejemplo n.º 6
0
 public void DrawFade(SpriteBatchProxy spriteBatch)
 {
     spriteBatch.DrawRectangle(new Rectangle(0, 0, Resolution.VirtualWidth, Resolution.VirtualHeight), _fadingColor * _currentFadeInOut);
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Render the game state
 /// </summary>
 /// <param name="spriteBatch"></param>
 public abstract void Draw(SpriteBatchProxy spriteBatch);