本文整理汇总了C#中Microsoft.Xna.Framework.Graphics.SpriteBatch.DrawRightText方法的典型用法代码示例。如果您正苦于以下问题:C# SpriteBatch.DrawRightText方法的具体用法?C# SpriteBatch.DrawRightText怎么用?C# SpriteBatch.DrawRightText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Xna.Framework.Graphics.SpriteBatch
的用法示例。
在下文中一共展示了SpriteBatch.DrawRightText方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Draw
public void Draw(SpriteBatch spriteBatch)
{
var screenSize = SceneManager.Instance.VirtualSize;
var fontBig = SceneManager.Instance.GameFontBig;
var font = SceneManager.Instance.GameFont;
var format = "{0}/{1}";
spriteBatch.Draw(_background, new Rectangle(0, 0, (int)screenSize.X, (int)screenSize.Y), Color.White * 0.5f);
var coinsLPos = new Vector2(_rowsInnerPositionsLeft[0, Current], 60);
var coinsRPos = new Vector2(_rowsInnerPositionsRight[0], 60);
var heartsLPos = new Vector2(_rowsInnerPositionsLeft[1, Current], 85);
var heartsRPos = new Vector2(_rowsInnerPositionsRight[1], 85);
var enemiesLPos = new Vector2(_rowsInnerPositionsLeft[2, Current], 110);
var enemiesRPos = new Vector2(_rowsInnerPositionsRight[2], 110);
var timeLPos = new Vector2(_rowsInnerPositionsLeft[3, Current], 135);
var timeRPos = new Vector2(_rowsInnerPositionsRight[3], 135);
spriteBatch.DrawTextWithShadow(fontBig, _completed ? TitleCompleted : TitleFailed, _titlePosition, Color.White);
var coinsStr = String.Format(format, _values[0, 0], _data.MaxCoins);
var coinsColor = CalculateColor(_values[0, 0], _data.MaxCoins);
spriteBatch.DrawTextWithShadow(font, CoinsEarned, coinsLPos, Color.White);
spriteBatch.DrawRightText(font, coinsStr, coinsRPos, coinsColor, Color.Black);
var heartsColor = CalculateColor(_values[1, 0], 0);
spriteBatch.DrawTextWithShadow(font, HeartsLost, heartsLPos, Color.White);
spriteBatch.DrawRightText(font, _values[1, 0].ToString(), heartsRPos, heartsColor, Color.Black);
var enemiesStr = String.Format(format, _values[2, 0], _data.MaxEnemies);
var enemiesColor = CalculateColor(_values[2, 0], _data.MaxEnemies);
spriteBatch.DrawTextWithShadow(font, EnemiesDefeated, enemiesLPos, Color.White);
spriteBatch.DrawRightText(font, enemiesStr, enemiesRPos, enemiesColor, Color.Black);
var timeColor = CalculateColor(_timeValues[0], _data.MaxTime);
spriteBatch.DrawTextWithShadow(font, Time, timeLPos, Color.White);
spriteBatch.DrawRightText(font, FormatTime(_timeValues[0]), timeRPos, timeColor, Color.Black);
if (_phase >= 1)
{
spriteBatch.DrawTextWithShadow(font, _rankSentences[_rank], _rankSentencePosition, Color.White * _rankSentenceAlpha);
if (_rank == "S")
((AnimatedSprite)_rankSprite).Draw(spriteBatch);
else
_rankSprite.Draw(spriteBatch);
}
IconsManager.Instance.DrawActionButton(spriteBatch, new Vector2(5, screenSize.Y - 40), false, "Continue", _buttonsAlpha, true);
IconsManager.Instance.DrawCancelButton(spriteBatch, new Vector2(5, screenSize.Y - 20), false, "Again", _buttonsAlpha, true);
}