Ejemplo n.º 1
0
        public void DrawFront(SpriteBatch spriteBatch, Camera cam)
        {
            if (renderer == null)
            {
                return;
            }
            renderer.Draw(spriteBatch, cam);

            if (GameMain.DebugDraw)
            {
                foreach (InterestingPosition pos in positionsOfInterest)
                {
                    Color color = Color.Yellow;
                    if (pos.PositionType == PositionType.Cave)
                    {
                        color = Color.DarkOrange;
                    }
                    else if (pos.PositionType == PositionType.Ruin)
                    {
                        color = Color.LightGray;
                    }

                    GUI.DrawRectangle(spriteBatch, new Vector2(pos.Position.X - 15.0f, -pos.Position.Y - 15.0f), new Vector2(30.0f, 30.0f), color, true);
                }

                foreach (RuinGeneration.Ruin ruin in ruins)
                {
                    Rectangle ruinArea = ruin.Area;
                    ruinArea.Y = -ruinArea.Y - ruinArea.Height;

                    GUI.DrawRectangle(spriteBatch, ruinArea, Color.DarkSlateBlue, false, 0, 5);
                }
            }
        }
Ejemplo n.º 2
0
        public void DrawFront(SpriteBatch spriteBatch)
        {
            if (renderer == null)
            {
                return;
            }
            renderer.Draw(spriteBatch);

            if (GameMain.DebugDraw)
            {
                foreach (InterestingPosition pos in positionsOfInterest)
                {
                    Color color = Color.Yellow;
                    if (pos.PositionType == PositionType.Cave)
                    {
                        color = Color.DarkOrange;
                    }
                    else if (pos.PositionType == PositionType.Ruin)
                    {
                        color = Color.LightGray;
                    }


                    GUI.DrawRectangle(spriteBatch, new Vector2(pos.Position.X - 15.0f, -pos.Position.Y - 15.0f), new Vector2(30.0f, 30.0f), color, true);
                }
            }
        }
Ejemplo n.º 3
0
        public void DrawFront(SpriteBatch spriteBatch, Camera cam)
        {
            if (renderer == null)
            {
                return;
            }
            renderer.Draw(spriteBatch, cam);

            if (GameMain.DebugDraw && Screen.Selected.Cam.Zoom > 0.1f)
            {
                foreach (InterestingPosition pos in PositionsOfInterest)
                {
                    Color color = Color.Yellow;
                    if (pos.PositionType == PositionType.Cave)
                    {
                        color = Color.DarkOrange;
                    }
                    else if (pos.PositionType == PositionType.Ruin)
                    {
                        color = Color.LightGray;
                    }

                    GUI.DrawRectangle(spriteBatch, new Vector2(pos.Position.X - 15.0f, -pos.Position.Y - 15.0f), new Vector2(30.0f, 30.0f), color, true);
                }

                foreach (RuinGeneration.Ruin ruin in Ruins)
                {
                    Rectangle ruinArea = ruin.Area;
                    ruinArea.Y = -ruinArea.Y - ruinArea.Height;

                    GUI.DrawRectangle(spriteBatch, ruinArea, Color.DarkSlateBlue, false, 0, 5);
                }

                foreach (var positions in wreckPositions.Values)
                {
                    for (int i = 0; i < positions.Count; i++)
                    {
                        float t          = (i + 1) / (float)positions.Count;
                        float multiplier = MathHelper.Lerp(0, 1, t);
                        Color color      = Color.Red * multiplier;
                        var   pos        = positions[i];
                        pos.Y = -pos.Y;
                        var size = new Vector2(100);
                        GUI.DrawRectangle(spriteBatch, pos - size / 2, size, color, thickness: 10);
                        if (i < positions.Count - 1)
                        {
                            var nextPos = positions[i + 1];
                            nextPos.Y = -nextPos.Y;
                            GUI.DrawLine(spriteBatch, pos, nextPos, color, width: 10);
                        }
                    }
                }
                foreach (var rects in blockedRects.Values)
                {
                    foreach (var rect in rects)
                    {
                        Rectangle newRect = rect;
                        newRect.Y = -newRect.Y;
                        GUI.DrawRectangle(spriteBatch, newRect, Color.Red, thickness: 5);
                    }
                }
            }
        }