Draw lines between connections

This commit is contained in:
2022-09-08 02:35:24 +00:00
parent a250339e70
commit 26ab037ec9
3 changed files with 8 additions and 1 deletions

View File

@@ -18,7 +18,9 @@
(playState.entryGroup.add sprite) (playState.entryGroup.add sprite)
(dictSet sprites e.id sprite))) (dictSet sprites e.id sprite)))
->[archive e pos e2 pos2 &opt ui] ->[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] ->[archive e &opt ui]
{ {
(whenLet [sprite (dictGet sprites e.id)] (whenLet [sprite (dictGet sprites e.id)]
@@ -31,6 +33,7 @@
})) }))
(method &override :Void clear [] (method &override :Void clear []
(playState.debugLayer.clear)
(sprites.clear) (sprites.clear)
(playState.entryGroup.kill) (playState.entryGroup.kill)
(playState.entryGroup.clear) (playState.entryGroup.clear)

View File

@@ -18,6 +18,7 @@ import flixel.math.FlxRect;
import flixel.addons.plugin.FlxMouseControl; import flixel.addons.plugin.FlxMouseControl;
import flixel.input.mouse.FlxMouseEventManager; import flixel.input.mouse.FlxMouseEventManager;
using StringTools; using StringTools;
using kiss_flixel.DebugLayer;
using kiss_flixel.CameraTools; using kiss_flixel.CameraTools;
import kiss_tools.KeyShortcutHandler; import kiss_tools.KeyShortcutHandler;
import kiss_tools.FlxKeyShortcutHandler; import kiss_tools.FlxKeyShortcutHandler;

View File

@@ -34,6 +34,9 @@
(prop :FlxTypedGroup<EntrySprite> entryGroup (new FlxTypedGroup<EntrySprite>)) (prop :FlxTypedGroup<EntrySprite> entryGroup (new FlxTypedGroup<EntrySprite>))
(add entryGroup) (add entryGroup)
(prop debugLayer (new DebugLayer))
(add debugLayer)
(prop uiCamera (new FlxCamera 0 0 FlxG.width FlxG.height)) (prop uiCamera (new FlxCamera 0 0 FlxG.width FlxG.height))
(set uiCamera.bgColor FlxColor.TRANSPARENT) (set uiCamera.bgColor FlxColor.TRANSPARENT)
(FlxG.cameras.add uiCamera false) (FlxG.cameras.add uiCamera false)