private void DrawDebugRect() { if (!DebugDraw) { return; } var colorEdge = DebugColor.WithAlpha(0.50f).Convert(); var colorFill = DebugColor.WithAlpha(0.25f).Convert(); var aabb = Owner.GetComponent<BoundingBoxComponent>().AABB; const int ppm = EyeManager.PIXELSPERMETER; var rect = new Godot.Rect2(aabb.Left * ppm, aabb.Top * ppm, aabb.Width * ppm, aabb.Height * ppm); debugNode.DrawRect(rect, colorEdge, filled: false); rect.Position += new Godot.Vector2(1, 1); rect.Size -= new Godot.Vector2(2, 2); debugNode.DrawRect(rect, colorFill, filled: true); }
public static UIBox2 Convert(this Godot.Rect2 rect) { return(new UIBox2(rect.Position.x, rect.Position.y, rect.End.x, rect.End.y)); }