diff --git a/projects/hollywoo-flixel/src/hollywoo_flixel/FlxDirector.hx b/projects/hollywoo-flixel/src/hollywoo_flixel/FlxDirector.hx index b943a027..8f2395da 100644 --- a/projects/hollywoo-flixel/src/hollywoo_flixel/FlxDirector.hx +++ b/projects/hollywoo-flixel/src/hollywoo_flixel/FlxDirector.hx @@ -30,6 +30,7 @@ import openfl.display.BitmapData; import openfl.display.BitmapDataChannel; import openfl.geom.Rectangle; import openfl.geom.Point; +import flixel.input.mouse.FlxMouseEventManager; @:build(kiss.Kiss.build()) class FlxDirector implements Director { @@ -40,6 +41,6 @@ class FlxDirector implements Director choices :String->Void submit] + (kiss_flixel.SimpleWindow.promptForChoice + prompt + choices + submit + FlxColor.BLACK + FlxColor.WHITE + 0.8 + 0.8 + true + "escape" + "left" + "right")) + +(method :Void defineFlxPoint [:FlxPoint->Void submit] + (unless mm + (set mm (new FlxMouseEventManager)) + (FlxG.state.add mm)) + (let [screen (new FlxSprite)] + (screen.makeGraphic FlxG.width FlxG.height (FlxColor.fromRGBFloat 0 1 0 0.2)) + (set screen.cameras [flxMovie.uiCamera]) + (mm.add screen + ->screen { + (mm.remove screen) + (FlxG.state.remove screen) + (submit (FlxG.mouse.getScreenPosition flxMovie.uiCamera)) + }) + (FlxG.state.add screen))) + (method :Void defineLightSource [:FlxLightSource->Void submit] - // TODO - (submit (new FlxLightSource [(new FlxPoint 830 225) (new FlxPoint 316 719) (new FlxPoint 1120 719)] FlxColor.TRANSPARENT))) + (let [points []] + (withFunctions + [ + (getNextPoint [] + (defineFlxPoint + ->point + { + (points.push point) + (getNextPoint) + })) + ] + (getNextPoint) + (sh.registerItem + "{enter} submit light source" + (onceLambda [cc] + (when points + // TODO allow color choice + (submit (new FlxLightSource points FlxColor.TRANSPARENT))) + (cc)))))) (method :Void showLighting [:SceneTime sceneTime :Array lightSources :FlxCamera camera] (set lightSprite (new FlxSprite)) diff --git a/projects/hollywoo/src/hollywoo/Movie.kiss b/projects/hollywoo/src/hollywoo/Movie.kiss index b379fdbb..259778f6 100644 --- a/projects/hollywoo/src/hollywoo/Movie.kiss +++ b/projects/hollywoo/src/hollywoo/Movie.kiss @@ -196,6 +196,8 @@ }) (shortcutHandler.registerItem "{escape} Pause the movie" ->cc (director.showPauseMenu cc)) + + // TODO (#when debug) (shortcutHandler.registerItem "[d]efine [l]ight source" ->cc (director.defineLightSource