From 26ab037ec9b5b35fd0201289edcd82922244d2b2 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Thu, 8 Sep 2022 02:35:24 +0000 Subject: [PATCH] Draw lines between connections --- .../source/EntrySpriteSystem.kiss | 5 ++++- projects/nat-flixel-desktop-playground/source/PlayState.hx | 1 + projects/nat-flixel-desktop-playground/source/PlayState.kiss | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/projects/nat-flixel-desktop-playground/source/EntrySpriteSystem.kiss b/projects/nat-flixel-desktop-playground/source/EntrySpriteSystem.kiss index 86491c49..d050c56f 100644 --- a/projects/nat-flixel-desktop-playground/source/EntrySpriteSystem.kiss +++ b/projects/nat-flixel-desktop-playground/source/EntrySpriteSystem.kiss @@ -18,7 +18,9 @@ (playState.entryGroup.add sprite) (dictSet sprites e.id sprite))) ->[archive e pos e2 pos2 &opt ui] - ~"$e $e2" + (let [o .origin (dictGet sprites e.id) + o2 .origin (dictGet sprites e2.id)] + (playState.debugLayer.drawLine (+ pos.x o.x) (+ pos.y o.y) (+ pos2.x o2.x) (+ pos2.y o2.y) FlxColor.LIME)) ->[archive e &opt ui] { (whenLet [sprite (dictGet sprites e.id)] @@ -31,6 +33,7 @@ })) (method &override :Void clear [] + (playState.debugLayer.clear) (sprites.clear) (playState.entryGroup.kill) (playState.entryGroup.clear) diff --git a/projects/nat-flixel-desktop-playground/source/PlayState.hx b/projects/nat-flixel-desktop-playground/source/PlayState.hx index 5b311d95..e9290586 100644 --- a/projects/nat-flixel-desktop-playground/source/PlayState.hx +++ b/projects/nat-flixel-desktop-playground/source/PlayState.hx @@ -18,6 +18,7 @@ import flixel.math.FlxRect; import flixel.addons.plugin.FlxMouseControl; import flixel.input.mouse.FlxMouseEventManager; using StringTools; +using kiss_flixel.DebugLayer; using kiss_flixel.CameraTools; import kiss_tools.KeyShortcutHandler; import kiss_tools.FlxKeyShortcutHandler; diff --git a/projects/nat-flixel-desktop-playground/source/PlayState.kiss b/projects/nat-flixel-desktop-playground/source/PlayState.kiss index 12eb8b61..b0a15f33 100644 --- a/projects/nat-flixel-desktop-playground/source/PlayState.kiss +++ b/projects/nat-flixel-desktop-playground/source/PlayState.kiss @@ -34,6 +34,9 @@ (prop :FlxTypedGroup entryGroup (new FlxTypedGroup)) (add entryGroup) + (prop debugLayer (new DebugLayer)) + (add debugLayer) + (prop uiCamera (new FlxCamera 0 0 FlxG.width FlxG.height)) (set uiCamera.bgColor FlxColor.TRANSPARENT) (FlxG.cameras.add uiCamera false)