public void Draw(SpriteBatchProxy spriteBatch) { if (_alpha > 0) { spriteBatch.BeginNoCamera(); string str = _currentSong.Artist + " - " + _currentSong.Name; Vector2 size = Application.MagicContentManager.Font.MeasureString(str); Vector2 loc = new Vector2(Resolution.VirtualWidth - size.X - 10, 50); var dstMenu = new Rectangle((int)(loc.X - 20), (int)loc.Y - 2 * (int)size.Y / 4, (int)size.X * 3 / 2, (int)size.Y * 2); var srcMenu = new Rectangle(0, 0, 127, 32); spriteBatch.Draw(Application.MagicContentManager.GetTexture("menu"), dstMenu, srcMenu, Color.White * _alpha, 0f, Vector2.Zero, Microsoft.Xna.Framework.Graphics.SpriteEffects.FlipHorizontally, 1.0f); spriteBatch.DrawString(Application.MagicContentManager.Font, str, loc, Color.White * _alpha); spriteBatch.End(); } }
public void Draw(SpriteBatchProxy spritebatch) { if (currentState == STATE.INACTIVE) return; Rectangle rect = _dstRect; rect.Width = POSITIONS[currentIdx]; spritebatch.Draw(nullTex, rect, Color.Green); rect.Offset(POSITIONS[currentIdx], 0); rect.Width = _dstRect.Width - POSITIONS[currentIdx]; spritebatch.Draw(nullTex, rect, color); spritebatch.Draw(barcodeTex, _dstRect, Color.White); //render number Vector2 v = new Vector2(80, 248); v += position; for (int i = 0; i < BARCODE_LENGTH; i++) { spritebatch.DrawString(font, barcodeDigits[i].ToString(), v, (i < currentIdx) ? Color.Green : color); v.X += 30; if (i == 4) v.X += 25; } if (currentState == STATE.GOOD_ANIM) { v.Y += 50; v.X = _dstRect.X + (_dstRect.Width - font.MeasureString(RANK_TEXT[rank]).X) / 2; spritebatch.DrawString(font, RANK_TEXT[rank], v, Color.Pink); } }
public virtual void Draw(SpriteBatchProxy spriteBatch) { spriteBatch.Draw(Application.MagicContentManager.GetTexture("particules"), Location, src, color * alpha, rotation, particuleOrigin, scale, SpriteEffects.None, 1.0f); }
/// <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); } } } }