本文整理匯總了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);
}