/// <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); } } } }
/// <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); } } } }
/// <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); }
public virtual void Draw(SpriteBatchProxy spriteBatch) { spriteBatch.Draw(Application.MagicContentManager.GetTexture("particules"), Location, src, color * alpha, rotation, particuleOrigin, scale, SpriteEffects.None, 1.0f); }
/// <summary> /// Render the game state /// </summary> /// <param name="spriteBatch"></param> public override void Draw(SpriteBatchProxy spriteBatch) { }
public void DrawFade(SpriteBatchProxy spriteBatch) { spriteBatch.DrawRectangle(new Rectangle(0, 0, Resolution.VirtualWidth, Resolution.VirtualHeight), _fadingColor * _currentFadeInOut); }
/// <summary> /// Render the game state /// </summary> /// <param name="spriteBatch"></param> public abstract void Draw(SpriteBatchProxy spriteBatch);