当前位置: 首页>>代码示例>>C#>>正文


C# TextBuffer.Clear方法代码示例

本文整理汇总了C#中TextBuffer.Clear方法的典型用法代码示例。如果您正苦于以下问题:C# TextBuffer.Clear方法的具体用法?C# TextBuffer.Clear怎么用?C# TextBuffer.Clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TextBuffer的用法示例。


在下文中一共展示了TextBuffer.Clear方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
        }
开发者ID:cartman300,项目名称:Tetraquark,代码行数:48,代码来源:MenuState.cs

示例2: TextWithGroupRuby

 public void TextWithGroupRuby(UString baseText, UString rubyText)
 {
     var baseBuffer = new TextBuffer(_zwSize, _wordWrap, _advancing, _latinMetric, 64);
     var rubyBuffer = new TextBuffer(_rubyZwSize, _wordWrap, _advancing, _latinMetric, 128);
     _buffer.MoveLastLetterStateTo(baseBuffer);
     baseBuffer.Append(baseText);
     rubyBuffer.Append(rubyText);
     _buffer.AppendObject(new GroupRuby(baseBuffer.ToArray(), rubyBuffer.ToArray()));
     baseBuffer.MoveLastLetterStateTo(_buffer);
     baseBuffer.Clear();
     rubyBuffer.Clear();
 }
开发者ID:karak,项目名称:Geovanni,代码行数:12,代码来源:ParagraphBuilder.cs


注:本文中的TextBuffer.Clear方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。