Exemplo n.º 1
0
 /// <summary>
 /// Used to render debug information in console.
 /// </summary>
 public override void RenderDebug(SFML.Graphics.VertexArray vertexArray)
 {
     foreach (Mask m in _masks)
     {
         m.RenderDebug(vertexArray);
     }
 }
Exemplo n.º 2
0
        private void RenderEntities()
        {
            if (_debug)
            {
                var verts = new SFML.Graphics.VertexArray(SFML.Graphics.PrimitiveType.Lines);

//				var g:Graphics = _entScreen.graphics,
//					sx:Number = FP.screen.scaleX * FP.screen.scale,
//					sy:Number = FP.screen.scaleY * FP.screen.scale;
//				g.clear();

                var scale = FP.Camera.Zoom;
                foreach (var e in SCREEN_LIST)
                {
                    // If the Entity is not selected.
//					if (SELECT_LIST.indexOf(e) < 0)
//					{
//						 Draw the normal hitbox and position.

                    var color  = FP.Color(0xff0000);
                    var x      = e.X - e.OriginX - (FP.Camera.X - FP.HalfWidth);
                    var y      = e.Y - e.OriginY - (FP.Camera.Y - FP.HalfHeight);
                    var width  = e.Width;
                    var height = e.Height;

                    if (e.Width != 0 && e.Height != 0)
                    {
                        if (e.Mask != null)
                        {
                            e.Mask.RenderDebug(verts);
                        }

                        Draw.Rect(x, y, width, height, color);
                    }

                    color  = FP.Color(0x00ff00);
                    x      = e.X - (FP.Camera.X - FP.HalfWidth) - 3;
                    y      = e.Y - (FP.Camera.Y - FP.HalfHeight) - 3;
                    width  = 6;
                    height = 6;

                    Draw.Rect(x, y, width, height, color);
//					}
//					else
//					{
//						// Draw the selected hitbox and position.
//						if (e.width && e.height)
//						{
//							g.lineStyle(1, 0xFFFFFF);
//							g.drawRect((e.x - e.originX - FP.camera.x) * sx, (e.y - e.originY - FP.camera.y) * sy, e.width * sx, e.height * sy);
//							if (e.mask) e.mask.renderDebug(g);
//						}
//						g.lineStyle(1, 0xFFFFFF);
//						g.drawRect((e.x - FP.camera.x) * sx - 3, (e.y - FP.camera.y) * sy - 3, 6, 6);
//					}
                }

                FP.Screen.Draw(verts);
            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// Used to render debug information in console.
 /// </summary>
 /// <param name="vertexArray">The vertex array to add vertices to in order to display.</param>
 public virtual void RenderDebug(SFML.Graphics.VertexArray vertexArray)
 {
 }