示例#1
0
        void Render()
        {
            Window.Clear(LetterBoxColor.SFMLColor);
            Surface.FillColor = Color;
            Surface.Fill(Color);

            Draw.GameTarget = Surface;

            Draw.SpriteBatch.Begin(); // Spritebatch test?

            if (DrawInactiveScenes)
            {
                foreach (Scene scene in Scenes.Reverse())
                {
                    if (Scene != scene)
                    {
                        scenesToRender.Add(scene);
                    }
                    if (!scene.DrawScenesBelow)
                    {
                        scenesToRender = new List <Scene>();
                        if (Scene != scene)
                        {
                            scenesToRender.Add(scene);
                        }
                    }
                }
                for (int i = 0; i < scenesToRender.Count; i++)
                {
                    scenesToRender[i].RenderInternal();
                }
                scenesToRender = new List <Scene>();
            }

            if (Scene != null)
            {
                Scene.RenderInternal();
            }

            Draw.SpriteBatch.End(); // Spritebatch test?

            Draw.ResetTarget();
            foreach (var surface in Surfaces)
            {
                Draw.Graphic(surface);
            }

            Surface.DrawToWindow(this);

            if (Debugger != null)
            {
                Debugger.Render();
            }

            Window.Display();
        }
示例#2
0
        internal void Render()
        {
            game.countRendering = false;

            var tempTarget = Draw.Target;

            Draw.SetTarget(renderSurface);

            Draw.Graphic(textPerformance, x, y);

            if (dismissFor > 0)
            {
                Draw.Graphic(textFramesLeft, x, y);
            }

            if (Visible)
            {
                Draw.Graphic(imgOverlay, x, y);
                Draw.Graphic(imgOtter, x, y);
                Draw.Graphic(imgError, x, y);

                if (countDownTimer > 0)
                {
                    Draw.Graphic(textCountdown, x, y);
                }
                else
                {
                    Draw.Graphic(imgScrollBarBg, x, y);
                    Draw.Graphic(imgScrollBar, x, y);
                    Draw.Graphic(textInput, x, y);
                    Draw.Graphic(textInputHelp, x, y);
                    Draw.Graphic(textPastCommands, x, y);
                    Draw.Graphic(textCommandsBuffered, x, y);
                }
            }
            else
            {
                if (liveConsoleLines > 0)
                {
                    Draw.Graphic(textPastCommandsLive, x, y);
                }
            }

            if (currentState == stateCamera)
            {
                Draw.Graphic(textCamera, x, y);
            }

            Draw.SetTarget(tempTarget);

            renderSurface.DrawToWindow(game);

            game.countRendering = true;
        }
示例#3
0
        /// <summary>
        /// Draw the collider for debug purposes.
        /// </summary>
        public override void Render()
        {
            base.Render();

            if (Entity == null)
            {
                return;
            }

            if (!rendered)
            {
                rendered = true;
                InitializeTexture();
            }

            Draw.Graphic(visibleImage, Left, Top);
        }
示例#4
0
        public override void Render()
        {
            base.Render();

            if (Entity == null)
            {
                return;
            }

            graphicVertices = new Vertices();
            graphicVertices.PrimitiveType = VertexPrimitiveType.LinesStrip;
            foreach (var v in Polygon.Points)
            {
                graphicVertices.Add(new Vert(v.X, v.Y, Color.Red));
            }
            graphicVertices.Add(new Vert(Polygon.Points[0].X, Polygon.Points[0].Y, Color.Red));
            Draw.Graphic(graphicVertices, Left, Top);
        }
示例#5
0
        /// <summary>
        /// Draw the collider for debug purposes.
        /// </summary>
        public override void Render(Color color = null)
        {
            base.Render(color);
            if (color == null)
            {
                color = Color.Red;
            }

            if (Entity == null)
            {
                return;
            }

            if (!rendered)
            {
                rendered = true;
                InitializeTexture();
            }

            visibleImage.Color = color;
            Draw.Graphic(visibleImage, Left, Top);
        }
示例#6
0
 /// <summary>
 /// Draws simple Text.  Should only be used for debugging as this creates Text Graphics each time it's called!
 /// </summary>
 /// <param name="str">The string to display.</param>
 /// <param name="size">The size of the Text.</param>
 /// <param name="x">The X position to render the Text from.</param>
 /// <param name="y">The Y position to render the Text from.</param>
 public static void Text(string str, int size, float x = 0, float y = 0)
 {
     Draw.Graphic(new Text(str, size), x, y);
 }