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


C# Renderer.DrawStringLeft方法代码示例

本文整理汇总了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();
        }
开发者ID:XZelnar,项目名称:MicroWorld,代码行数:25,代码来源:LevelSelectorItem.cs

示例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);
        }
开发者ID:XZelnar,项目名称:MicroWorld,代码行数:43,代码来源:SimulationSpeedPanel.cs

示例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));
            }
        }
开发者ID:XZelnar,项目名称:MicroWorld,代码行数:22,代码来源:GlobalLoad.cs

示例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);
        }
开发者ID:XZelnar,项目名称:MicroWorld,代码行数:10,代码来源:OverlayToolTip.cs


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