本文整理汇总了C#中TextBuffer.SetFontTexture方法的典型用法代码示例。如果您正苦于以下问题:C# TextBuffer.SetFontTexture方法的具体用法?C# TextBuffer.SetFontTexture怎么用?C# TextBuffer.SetFontTexture使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextBuffer
的用法示例。
在下文中一共展示了TextBuffer.SetFontTexture方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MenuState
public MenuState()
{
GUIText = new TextBuffer(80, 30);
GUIText.SetFontTexture(ResourceMgr.Get<Texture>("font"));
GUIText.Sprite.Scale = Renderer.Screen.Size.ToVec2f().Divide(GUIText.Sprite.Texture.Size.ToVec2f());
GUIText.Sprite.Position = Renderer.Screen.Texture.Size.ToVec2f() / 2;
GUIText.Sprite.Origin = GUIText.Sprite.Texture.Size.ToVec2f() / 2;
AAA = new RenderSprite(Renderer.Screen.Size);
BBB = new RenderSprite(Renderer.Screen.Size);
CRT = new RenderSprite(Renderer.Screen.Size);
MainMenu = new MenuEntry("Main Menu");
if (Renderer.CountStates() > 0)
MainMenu.Add(new WidgetButton("Continue Universe", () => Renderer.PopState()));
MainMenu
.Add(new WidgetButton("Create Universe", () => Renderer.PushState(new GameState())))
.Add(new WidgetButton("Load Universe", () => CurrentMenu = LoadUniverse).Disable())
.Add(new WidgetButton("Universal Constants", () => CurrentMenu = Constants))
.Add(new WidgetButton("Terminate", () => Program.Running = false));
Action BackToMainMenu = () => {
GUIText.Clear();
CurrentMenu = MainMenu;
};
LoadUniverse = new MenuEntry("Load Universe")
.Add(new WidgetButton("Back", BackToMainMenu));
Constants = new MenuEntry("Universal Constants")
.Add(new WidgetTextbox("Resolution X", Program.ResX.ToString(), 6, (S) => {
if (S.Length > 0)
Program.ResX = int.Parse(S);
GUIText.Print(0, 0, "Restart required for changes to take effect");
}, char.IsNumber))
.Add(new WidgetTextbox("Resolution Y", Program.ResY.ToString(), 6, (S) => {
if (S.Length > 0)
Program.ResY = int.Parse(S);
GUIText.Print(0, 0, "Restart required for changes to take effect");
}, char.IsNumber))
.Add(new WidgetCheckbox("Debug", Program.Debug, (B) => Program.Debug = B))
.Add(new WidgetCheckbox("Border", Program.Border, (B) => Program.Border = B))
.Add(new WidgetButton("Back", BackToMainMenu));
CurrentMenu = MainMenu;
CurrentMenu.DrawMenu(GUIText);
}