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


C# Renderer.Draw方法代码示例

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


在下文中一共展示了Renderer.Draw方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Draw

        public override void Draw(Renderer renderer)
        {
            if (!isVisible) return;
            if (image == null)
            {
                base.Draw(renderer);
                return;
            }

            renderer.Draw(image, new Rectangle((int)position.X, (int)position.Y, (int)size.X, (int)size.Y),
                Color.White);

            if (!isEnabled)
            {
                renderer.Draw(GraphicsEngine.pixel,
                    new Rectangle((int)position.X + 2, (int)position.Y + 2, (int)size.X - 4, (int)size.Y - 4),
                    Shortcuts.BG_COLOR * 0.5f);
            }

            renderer.End();
            renderer.BeginUnscaled(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.LinearWrap,
                DepthStencilState.Default, RasterizerState.CullNone);
            renderer.Draw(overPattern,
                new Rectangle((int)position.X + 2, (int)position.Y + 2, (int)size.X - 4, (int)size.Y - 4),
                new Rectangle((int)position.X + 2, (int)position.Y + 2, (int)size.X - 4, (int)size.Y - 4),
                Color.White * HighlightForce);
            renderer.End();
            renderer.BeginUnscaled();
        }
开发者ID:XZelnar,项目名称:MicroWorld,代码行数:29,代码来源:NewStyleButton.cs

示例2: Draw

        public override void Draw(Renderer renderer)
        {
            base.Draw(renderer);

            renderer.SetScissorRectangle(GUIEngine.s_mainMenu.line3p1.X, GUIEngine.s_mainMenu.line3p1.Y, Main.WindowWidth, Main.WindowHeight, false);
            renderer.End();
            renderer.BeginUnscaled(SpriteSortMode.Immediate, BlendState.AlphaBlend, null,
                null, Graphics.GraphicsEngine.s_ScissorsOn, null, Matrix.CreateTranslation(MainMenu.FrameOffset, 0, 0));

            Vector2 corner = Position + Size;
            renderer.Draw(GraphicsEngine.pixel,
                new Rectangle((int)(corner.X - 333), (int)(corner.Y - 1),
                    333, 1), Color.White);
            renderer.Draw(GraphicsEngine.pixel,
                new Rectangle((int)(corner.X - 1), (int)(corner.Y - (ShortUpperLine ? 29 : 96)),
                    1, (int)((ShortUpperLine ? 29 : 96) - (ButtonsCount == FrameButtonsCount.Zero ? 0 : 23))), Color.White);

            if (ButtonsCount != FrameButtonsCount.Zero)
            {
                renderer.Draw(GraphicsEngine.pixel,
                    new Rectangle((int)(corner.X - 120), (int)(corner.Y - 23),
                        1, 23), Color.White);
                int linew = ButtonsCount == FrameButtonsCount.One ? 120 : 240;
                renderer.Draw(GraphicsEngine.pixel,
                    new Rectangle((int)(corner.X - linew), (int)(corner.Y - 24),
                        linew, 1), Color.White);
            }
        }
开发者ID:XZelnar,项目名称:MicroWorld,代码行数:28,代码来源:MenuFrameScene.cs

示例3: Draw

        //TODO animation
        public override void Draw(Renderer renderer)
        {
            renderer.Draw(GraphicsEngine.pixel,
                new Rectangle(0, 0, Main.WindowWidth, Main.WindowHeight),
                Shortcuts.BG_COLOR * fadeopacity);
            bool b = OffsetX != 0;
            if (b)
            {
                renderer.SetScissorRectangle(position.X, position.Y, size.X, size.Y, false);
                renderer.End();
                renderer.BeginUnscaled(SpriteSortMode.Immediate, BlendState.AlphaBlend, null,
                    null, Graphics.GraphicsEngine.s_ScissorsOn, null, Matrix.CreateTranslation(OffsetX, 0, 0));
            }

            RenderHelper.SmartDrawRectangle(bg, 5,
                (int)position.X - 2, (int)position.Y - 2, (int)size.X + 4, (int)size.Y - 30 + 4,
                Color.White, renderer);

            base.Draw(renderer);

            renderer.Draw(title, position + new Vector2(64, 64), Color.White);

            renderer.Draw(GraphicsEngine.pixel,
                new Rectangle((int)(position.X + size.X / 4), (int)(position.Y + size.Y - 30), 1, 30),
                Color.White);
            renderer.Draw(GraphicsEngine.pixel,
                new Rectangle((int)(position.X + size.X / 2), (int)(position.Y + size.Y - 30), 1, 30),
                Color.White);
            renderer.Draw(GraphicsEngine.pixel,
                new Rectangle((int)(position.X + 3 * size.X / 4), (int)(position.Y + size.Y - 30), 1, 30),
                Color.White);

            if (b)
                renderer.ResetScissorRectangle();
        }
开发者ID:XZelnar,项目名称:MicroWorld,代码行数:36,代码来源:VictoryMessage.cs

示例4: 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

示例5: Draw

        public override void Draw(Renderer renderer)
        {
            base.Draw(renderer);

            renderer.Draw(tfolder, Position + new Vector2(26, 26), Color.White);
            renderer.Draw(GraphicsEngine.pixel, new Rectangle((int)Position.X - 9, (int)Position.Y + 95, (int)Size.X + 9, 1), Color.White);
            renderer.Draw(GraphicsEngine.pixel, new Rectangle((int)Position.X - 10 + (int)Size.X + 9, (int)Position.Y + 95, 1, 5), Color.White);
            if (saves.ItemsCount() == 0)
            {
                var a = overlayFont.MeasureString("No save files found");
                renderer.DrawString(overlayFont, "No save files found",
                    new Rectangle((int)saves.Position.X, (int)(saves.Position.Y + (saves.Size.Y - a.Y) / 2), (int)saves.Size.X, (int)a.Y),
                    Color.Gray, Renderer.TextAlignment.Center);
            }
        }
开发者ID:XZelnar,项目名称:MicroWorld,代码行数:15,代码来源:LoadFrameScene.cs

示例6: Draw

        public override void Draw(Renderer r)
        {
            base.Draw(r);

            r.Draw(texture, new Rectangle((int)Position.X, (int)Position.Y, (int)Size.X, (int)Size.Y),
                Color.White * opacity);
        }
开发者ID:XZelnar,项目名称:MicroWorld,代码行数:7,代码来源:StopHighlight.cs

示例7: Draw

        public override void Draw(Renderer r)
        {
            base.Draw(r);

            r.Draw(GraphicsEngine.pixel, new Rectangle((int)Position.X, (int)Position.Y, (int)Size.X, (int)Size.Y),
                color * opacity);
        }
开发者ID:XZelnar,项目名称:MicroWorld,代码行数:7,代码来源:Spark.cs

示例8: Draw

        public override void Draw(Renderer r)
        {
            base.Draw(r);

            r.Draw(texture, new Rectangle((int)Position.X, (int)Position.Y, (int)Size.X, (int)Size.Y),
                new Color(0, 0, 0) * color);
        }
开发者ID:XZelnar,项目名称:MicroWorld,代码行数:7,代码来源:Smoke.cs

示例9: Draw

        public override void Draw(Renderer renderer)
        {
            //tabs[selectedTab].isMouseOver = true;

            if (background != null) background.Draw(renderer);
            if (fadeSize.Y != Main.WindowHeight)
                renderer.SetScissorRectangle((int)(Main.WindowWidth - fadeSize.X) / 2, (int)(Main.WindowHeight - fadeSize.Y) / 2,
                    (int)fadeSize.X, (int)fadeSize.Y, false);
            renderer.Draw(bgtexture, new Rectangle(0, 0, Main.WindowWidth, Main.WindowHeight), Color.White);
            foreach (Control c in controls)
            {
                c.Draw(renderer);
            }
            for (int x = 0; x < levels.GetLength(0); x++)
            {
                for (int y = 0; y < levels.GetLength(1); y++)
                {
                    if (levels[x, y].isVisible)
                    {
                        renderer.Draw(wires[y * levels.GetLength(0) + x], new Rectangle(0, 0, Main.WindowWidth, Main.WindowHeight),
                            !levels[x, y].isEnabled ? wireDisabled :
                            levels[x, y].isPressed ? wireSelected :
                            levels[x,y].isMouseOver ? wireMouseOver :
                            Logics.CampaingProgress.IsComplete(TABS_NAMES[CurTab], y * levels.GetLength(0) + x) ? wireCompleted :
                            wireIdle);
                    }
                    //levels[x, y] = new ImageButton(16 + x * 96 + d, 54 + y * 90, 80, 80, (y * levels.GetLength(0) + x).ToString());
                }
            }
            if (fadeSize.X != Main.WindowWidth)
                renderer.ResetScissorRectangle();
        }
开发者ID:XZelnar,项目名称:MicroWorld,代码行数:32,代码来源:LevelSelector.cs

示例10: Draw

 public override void Draw(Renderer renderer)
 {
     renderer.Draw(GraphicsEngine.pixel, new Rectangle(0, 0, Main.WindowWidth, Main.WindowHeight), Color.Black);
     lock (l)
     {
         base.Draw(renderer);
     }
 }
开发者ID:XZelnar,项目名称:MicroWorld,代码行数:8,代码来源:IntroSequence.cs

示例11: AfterDraw

        public override void AfterDraw(Renderer renderer)
        {
            Intro intro = battleState as Intro;
            float time = intro == null ? (battleState as Outro).Time : intro.Time;

            Color color = new Color(0.0f, 0.0f, 0.0f, 1.0f - (time / Intro.FadeTimeInSeconds));
            renderer.Draw(pixelTextureData, Vector2.Zero, color, 0.0f, Game1.ScreenSize, false);
        }
开发者ID:supermaximo93,项目名称:SuperFantasticSteampunk,代码行数:8,代码来源:IntroOutroRenderer.cs

示例12: Draw

        public override void Draw(Renderer renderer)
        {
            if (!isActive)
                return;

            renderer.Draw(fbo, new Vector2(), Color.White * opacity);

            base.Draw(renderer);
        }
开发者ID:XZelnar,项目名称:MicroWorld,代码行数:9,代码来源:LightOverlay.cs

示例13: Draw

        public override void Draw(Renderer renderer)
        {
            #region fadeUpdate
            if (isclosing)
            {
                if (OffsetX > -size.X)
                    OffsetX -= 15;
                if (OffsetX <= -size.X)
                {
                    OffsetX = -(int)size.X;
                    Close();
                }
            }
            else
            {
                if (OffsetX < 0)
                    OffsetX += 15;
            }
            if (OffsetX > 0)
                OffsetX = 0;

            fadeopacity = (float)(OffsetX + size.X) / size.X / 2f;
            #endregion

            lock (compToDraw)
            {
                renderer.Draw(GraphicsEngine.pixel, new Rectangle(0, 0, Main.WindowWidth, Main.WindowHeight), Shortcuts.BG_COLOR * fadeopacity);
                bool b = OffsetX != 0;
                if (b)
                {
                    renderer.SetScissorRectangle(pos.X, pos.Y, size.X, size.Y, false);
                    renderer.End();
                    renderer.BeginUnscaled(SpriteSortMode.Immediate, BlendState.AlphaBlend, null,
                        null, Graphics.GraphicsEngine.s_ScissorsOn, null, Matrix.CreateTranslation(OffsetX, 0, 0));
                }

                RenderHelper.SmartDrawRectangle(GraphicsEngine.bg, 5,
                    (int)pos.X - 2, (int)pos.Y - 2, (int)size.X + 4, (int)size.Y - 30 + 4,
                    Color.White, renderer);

                int x = 5;
                int y = 30;
                for (int i = 0; i < compToDraw.Count; i++)
                {
                    compToDraw[i].DrawAt((int)pos.X + x, (int)pos.Y + y, renderer);
                    x += 50;
                    if (x + 50 >= size.X)
                    {
                        x = 0;
                        y += 50;
                    }
                }
                base.Draw(renderer);
                if (b)
                    renderer.ResetScissorRectangle();
            }
        }
开发者ID:XZelnar,项目名称:MicroWorld,代码行数:57,代码来源:Purpose.cs

示例14: Draw

 public override void Draw(Renderer renderer)
 {
     renderer.Draw(GraphicsEngine.pixel, new Rectangle(0, 0, Main.WindowWidth, Main.WindowHeight), Shortcuts.BG_COLOR * 0.5f);
     renderer.DrawString(GUIEngine.font, "Press the sequence (mouse and/or keyboard) you wish to select...",
         new Rectangle(0, 0, Main.WindowWidth, Main.WindowHeight), Color.White, Renderer.TextAlignment.Center);
     renderer.DrawString(GUIEngine.font, seq.ToString(GUIEngine.font, Main.windowWidth, true),
         new Rectangle(0, 50, Main.WindowWidth, Main.WindowHeight), Color.White, Renderer.TextAlignment.Center);
     base.Draw(renderer);
 }
开发者ID:XZelnar,项目名称:MicroWorld,代码行数:9,代码来源:SequenceSelection.cs

示例15: Draw

 public override void Draw(Renderer r)
 {
     r.End();
     _setUpShader();
     r.BeginUnscaled(SpriteSortMode.Immediate, BlendState.Additive, SamplerState.PointClamp, DepthStencilState.None, RasterizerState.CullNone,
             Graphics.Effects.Effects.shockWave);
     r.Draw(Shortcuts.pixel, new Rectangle(0, 0, Main.WindowWidth, Main.WindowHeight), color * 0.75f);
     r.End();
     r.Begin();
 }
开发者ID:XZelnar,项目名称:MicroWorld,代码行数:10,代码来源:EMPShockWave.cs


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