make SceneFlxStates SubStates
This commit is contained in:
@@ -13,9 +13,12 @@
|
||||
|
||||
(prop &mut :SceneFlxState currentState)
|
||||
(method :Void showScene [:Scene<String,FlxStagePosition,FlxStageFacing,FlxScreenPosition,ActorFlxSprite> scene :Appearance appearance :Continuation cc]
|
||||
// Close the last scene state
|
||||
(when currentState
|
||||
(currentState.close))
|
||||
// TODO on the first appearance, give a super (for some scenes but probably not others... hm....)
|
||||
(set currentState (cast scene SceneFlxState))
|
||||
(FlxG.switchState currentState)
|
||||
(FlxG.state.openSubState currentState)
|
||||
(cc))
|
||||
|
||||
(var STAGE_LEFT_X 150)
|
||||
@@ -70,14 +73,14 @@
|
||||
// Make a dialog box
|
||||
(unless dialogBox
|
||||
(set dialogBox (new FlxSprite DIALOG_X DIALOG_Y))
|
||||
(dialogBox.makeGraphic DIALOG_WIDTH DIALOG_HEIGHT DIALOG_BOX_COLOR)
|
||||
(currentState.add dialogBox))
|
||||
(dialogBox.makeGraphic DIALOG_WIDTH DIALOG_HEIGHT DIALOG_BOX_COLOR))
|
||||
(currentState.add dialogBox)
|
||||
(dialogBox.revive)
|
||||
// show the dialog
|
||||
(unless dialogText
|
||||
// TODO use FlxTypeText to reveal dialog gradually
|
||||
(set dialogText (new FlxText DIALOG_X DIALOG_Y DIALOG_WIDTH "" DIALOG_SIZE))
|
||||
(currentState.add dialogText))
|
||||
(set dialogText (new FlxText DIALOG_X DIALOG_Y DIALOG_WIDTH "" DIALOG_SIZE)))
|
||||
(currentState.add dialogText)
|
||||
(set dialogText.text text)
|
||||
// show the speaker name
|
||||
(unless speakerNameText
|
||||
|
@@ -2,6 +2,7 @@
|
||||
(prop &mut :FlxMovie movie)
|
||||
|
||||
(method &override :Void create []
|
||||
(set destroySubStates false)
|
||||
(super.create)
|
||||
(set director (new FlxDirector))
|
||||
(set movie (new FlxMovie director)))
|
||||
|
@@ -2,11 +2,11 @@ package hollywoo_flixel;
|
||||
|
||||
import kiss.Prelude;
|
||||
import kiss.List;
|
||||
import flixel.FlxState;
|
||||
import flixel.FlxSubState;
|
||||
import flixel.FlxSprite;
|
||||
import flixel.FlxG;
|
||||
import hollywoo.Scene;
|
||||
import hollywoo_flixel.FlxMovie;
|
||||
|
||||
@:build(kiss.Kiss.build())
|
||||
class SceneFlxState extends FlxState {}
|
||||
class SceneFlxState extends FlxSubState {}
|
||||
|
Reference in New Issue
Block a user