buttons to skip to labels

This commit is contained in:
2021-12-30 15:18:44 -07:00
parent 97010efa33
commit 9614983b63
2 changed files with 15 additions and 1 deletions

View File

@@ -33,6 +33,8 @@ enum FlxScreenPosition {
* Model/controller of a Hollywoo-Flixel film, and main execution script
*/
class FlxMovie extends Movie<String, FlxStagePosition, FlxStageFacing, FlxScreenPosition, ActorFlxSprite, FlxSound, String, FlxSprite, FlxSound> {
// Think of HollywooFlixelDSL.kiss as the corresponding Kiss file for this class!
public function new(director:FlxDirector, ?voiceLinesAssetPath:String) {
var voiceLinesJson = null;
if (voiceLinesAssetPath != null) {

View File

@@ -33,4 +33,16 @@
(method :Void update [:Float elapsed]
(#when debug
(when FlxG.keys.justPressed.N
(skipToNextLabel))))
(skipToNextLabel))
(when FlxG.keys.justPressed.L
(showLabelSkipButtons))))
(method :Void showLabelSkipButtons []
(let [runners (labelRunners)
buttons (new flixel.group.FlxGroup.FlxTypedGroup<flixel.ui.FlxButton>)]
(localVar &mut buttonY 0)
(doFor =>label runner runners
(let [b (new flixel.ui.FlxButton 0 buttonY label ->{(FlxG.state.remove buttons)(runner)})]
(buttons.add b))
(+= buttonY 20))
(FlxG.state.add buttons)))