本文整理汇总了C#中Renderer.DrawStringLeft方法的典型用法代码示例。如果您正苦于以下问题:C# Renderer.DrawStringLeft方法的具体用法?C# Renderer.DrawStringLeft怎么用?C# Renderer.DrawStringLeft使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Renderer
的用法示例。
在下文中一共展示了Renderer.DrawStringLeft方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawToFBO
public override void DrawToFBO(Renderer renderer)
{
renderer.BeginUnscaled();
renderer.Draw(GraphicsEngine.pixel,
new Rectangle(0, 0, (int)size.X, (int)size.Y),
isEnabled ? (isPressed ? pressedColor : (isMouseOver ? mouseOverColor : background)) : disabledColor);
if (textOld != Text)
{
textOld = Text;
stringSize = GUIEngine.font.MeasureString(Text);
}
renderer.DrawString(Font, Text, new Rectangle(MouseOverOffset + 10,
(int)size.Y - 22, (int)size.X, (int)size.Y), foreground, textAlignment);
//inside text
String t = Text.Substring(Text.Length - 1);
var a = bfont.MeasureString(t);
renderer.DrawStringLeft(bfont, t, new Vector2(3 + (size.X - 3 - a.X) / 2, 3 + (lines[3].Position.Y - 3 - a.Y) / 2), Color.White);
renderer.Draw(GraphicsEngine.pixel, new Rectangle(0, 0, 0, 0), Color.White);
renderer.DrawLinesList(lines);
renderer.End();
}
示例2: Draw
public override void Draw(Renderer renderer)
{
renderer.Draw(GraphicsEngine.pixel, new Rectangle((int)pos.X, (int)pos.Y, (int)size.X, (int)size.Y),
Shortcuts.BG_COLOR * 0.75f);
String s = "File: ";
if (GUIEngine.s_levelSelection.folder == "")
{
if (IO.SaveEngine.LastLoadedFile == "")
{
s += "Untitled_1";
}
else
{
if (IO.SaveEngine.LastLoadedFile.Length > 10)
s += IO.SaveEngine.LastLoadedFile.Substring(0, 10) + "..";
else
s += IO.SaveEngine.LastLoadedFile;
}
}
else
{
s += GUIEngine.s_levelSelection.folder.Substring(GUIEngine.s_levelSelection.folder.IndexOf('/') + 1);
s = s.Substring(0, s.Length - 1);
s += "_" + GUIEngine.s_levelSelection.selectedLevel.ToString();
}
s += "\r\n";
s += "Sacale: 1:";
String scale = ((float)Math.Round(Settings.GameScale * 100) / 100f).ToString();
String rs = "";
for (int i = 0; i < scale.Length; i++)
{
if (scale[i] == ',')
rs += ".";
else
rs += scale[i];
}
s += rs;
renderer.DrawStringLeft(GUIEngine.font, s, pos + new Vector2(4, 4), Color.White);
base.Draw(renderer);
}
示例3: Draw
public override void Draw(Renderer renderer)
{
if (warningFadeState < 100)
{
gradStart += 20 * Main.WindowWidth / 1920;
if (gradStart >= (439 + 1003) * Main.WindowWidth / 1920)
gradStart = (439 - 1003) * Main.WindowWidth / 1920;
renderer.Draw(fbo, new Vector2(), Color.White);
renderer.Draw(pixel, new Rectangle(0, 0, Main.windowWidth, Main.windowHeight), Color.Black * ((float)warningFadeState / 100f));
}
else
{
renderer.Draw(pixel, new Rectangle(0, 0, Main.windowWidth, Main.windowHeight), Color.Black);
renderer.DrawStringLeft(font, warningText, new Vector2(), Color.White);
renderer.DrawStringRight(fontSmall, "[Press any key to skip]", new Rectangle(0, Main.windowHeight - 23, Main.windowWidth, 23), Color.Gray);
if (warningFadeState < 200)
renderer.Draw(pixel, new Rectangle(0, 0, Main.windowWidth, Main.windowHeight), Color.Black * ((float)(200 - warningFadeState) / 100f));
else
renderer.Draw(pixel, new Rectangle(0, 0, Main.windowWidth, Main.windowHeight), Color.Black * ((float)(warningFadeState - 200) / 100f));
}
}
示例4: DrawFBO
public void DrawFBO(Renderer renderer)
{
renderer.Draw(GraphicsEngine.pixel, new Rectangle(0, 0, (int)size.X, (int)size.Y), bgColor);
renderer.Draw(GraphicsEngine.pixel, new Rectangle(0, 0, 1, (int)size.Y), Color.White);
renderer.Draw(GraphicsEngine.pixel, new Rectangle(0, 0, (int)size.X, 1), Color.White);
renderer.Draw(GraphicsEngine.pixel, new Rectangle((int)(size.X - 1), 0, 1, (int)size.Y), Color.White);
renderer.Draw(GraphicsEngine.pixel, new Rectangle(0, (int)(size.Y - 1), (int)size.X, 1), Color.White);
renderer.DrawStringLeft(GUIEngine.font, text, new Vector2(3, 3), Color.White);
}