show old position when redefining position

This commit is contained in:
2023-05-26 18:53:57 -06:00
parent c65820f722
commit eee264addd
3 changed files with 11 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
# @install: lix --silent download "gh://github.com/kiss-lang/hollywoo#128bb88c9c8a62421cadd459d54c6981ad7f51b2" into hollywoo/0.0.0/github/128bb88c9c8a62421cadd459d54c6981ad7f51b2
# @run: haxelib run-dir hollywoo "${HAXE_LIBCACHE}/hollywoo/0.0.0/github/128bb88c9c8a62421cadd459d54c6981ad7f51b2"
# @install: lix --silent download "gh://github.com/kiss-lang/hollywoo#f11b5e461c83c253c26f9d628aad83a6873f18f5" into hollywoo/0.0.0/github/f11b5e461c83c253c26f9d628aad83a6873f18f5
# @run: haxelib run-dir hollywoo "${HAXE_LIBCACHE}/hollywoo/0.0.0/github/f11b5e461c83c253c26f9d628aad83a6873f18f5"
-lib kiss
-lib kiss-tools
-cp ${HAXE_LIBCACHE}/hollywoo/0.0.0/github/128bb88c9c8a62421cadd459d54c6981ad7f51b2/src/
-cp ${HAXE_LIBCACHE}/hollywoo/0.0.0/github/f11b5e461c83c253c26f9d628aad83a6873f18f5/src/
-D hollywoo=0.0.0

View File

@@ -25,6 +25,7 @@ import flixel.math.FlxPoint;
import haxe.Constraints;
import kiss_flixel.SpriteTools;
import kiss_flixel.SimpleWindow;
import kiss_flixel.DebugLayer;
import haxe.ds.Option;
import kiss_tools.KeyShortcutHandler;
import kiss_tools.FlxKeyShortcutHandler;

View File

@@ -193,10 +193,15 @@
})
(FlxG.state.add screen)))
(method :Void defineStagePosition [:StagePosition->Void submit]
(method :Void defineStagePosition [:FlxCamera camera :StagePosition->Void submit &opt :StagePosition oldPos]
(let [db (new DebugLayer)]
(set db.cameras [camera])
(db.drawCircle oldPos.x oldPos.y 4 FlxColor.YELLOW 2)
(FlxG.state.add db)
(defineFlxPoint
->point
(submit (new StagePosition point.x point.y 0.0))))
{(FlxG.state.remove db)
(submit (new StagePosition point.x point.y 5.0))})))
(method :Void defineLightSource [:FlxLightSource->Void submit]
(let [points []]