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


C# Renderer.DrawLinesList方法代码示例

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


在下文中一共展示了Renderer.DrawLinesList方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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 void Draw(Renderer renderer)
 {
     arr[0] = p1;
     arr[1] = p2;
     if (opacity <= 1)
     {
         arr[0].Color *= opacity;
         arr[1].Color *= opacity;
     }
     renderer.DrawLinesList(arr);
 }
开发者ID:XZelnar,项目名称:MicroWorld,代码行数:11,代码来源:LightOverlay.cs

示例3: Draw

        public override void Draw(Renderer renderer)
        {
            if (background != null && (Main.CurState.StartsWith("GUI") ||
                (currentState.items.Count > 0 && currentState.items[0] != inGameItems[0] && currentState.items[0] != inGameItems[4].Children[0] &&
                currentState.caption != "HANDBOOK")))
            {
                gameBGOpacity = 0;
                background.Draw(renderer);
                var atr = GUIEngine.font.MeasureString(currentTip);
                renderer.DrawString(GUIEngine.font, ">> " + currentTip + " <<", new Rectangle(0, (int)(Main.WindowHeight - atr.Y), Main.WindowWidth, (int)atr.Y),
                    new Color(180, 255, 180), Renderer.TextAlignment.Center);
            }
            else
            {
                if (gameBGOpacity < 0.5f)
                    gameBGOpacity += 0.02f;
                renderer.Draw(MicroWorld.Graphics.GraphicsEngine.pixel, new Rectangle(0, 0, Main.WindowWidth, Main.WindowHeight),
                    new Color(45, 57, 107) * gameBGOpacity);
            }

            renderer.Draw(GraphicsEngine.pixel, new Rectangle(0, 0, 0, 0), Color.White);
            renderer.DrawLinesList(new VertexPositionColorTexture[]{
                new VertexPositionColorTexture(new Vector3(line1p1.X, line1p1.Y,0), Color.White, new Vector2()),
                new VertexPositionColorTexture(new Vector3(line1p2.X, line1p2.Y, 0), Color.White, new Vector2()),
                new VertexPositionColorTexture(new Vector3(line2p1.X, line2p1.Y,0), Color.White, new Vector2()),
                new VertexPositionColorTexture(new Vector3(line2p2.X, line2p2.Y, 0), Color.White, new Vector2()),
                new VertexPositionColorTexture(new Vector3(line3p1.X, line3p1.Y,0), Color.White, new Vector2()),
                new VertexPositionColorTexture(new Vector3(line3p2.X, line3p2.Y, 0), Color.White, new Vector2()),
                new VertexPositionColorTexture(new Vector3(line4p1.X, line4p1.Y,0), Color.White, new Vector2()),
                new VertexPositionColorTexture(new Vector3(line4p2.X, line4p2.Y, 0), Color.White, new Vector2())
            });

            renderer.SetScissorRectangle(line2p1.X+1, line1p1.Y, Main.WindowWidth, Main.WindowHeight, false);
            lock (controls)
            {
                foreach (Elements.Control c in controls)
                {
                    c.Draw(renderer);
                }
            }

            renderer.DrawString(fontCurrent, currentState.caption, new Vector2(CaptionPosition.X + 10, CaptionPosition.Y + 10), Color.White,
                Renderer.TextAlignment.Left);

            if (currentFrame != null && currentFrame.isVisible)
            {
                renderer.SetScissorRectangle(line3p1.X, line3p1.Y, Main.WindowWidth, Main.WindowHeight, false);
                renderer.End();
                renderer.BeginUnscaled(SpriteSortMode.Immediate, BlendState.AlphaBlend, null,
                    null, Graphics.GraphicsEngine.s_ScissorsOn, null, Matrix.CreateTranslation(FrameOffset, 0, 0));
                currentFrame.Draw(renderer);
            }
            renderer.ResetScissorRectangle();
        }
开发者ID:XZelnar,项目名称:MicroWorld,代码行数:54,代码来源:MainMenu.cs


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