diff --git a/src/DialogueBox.hx b/src/DialogueBox.hx index e00901c..c9299de 100644 --- a/src/DialogueBox.hx +++ b/src/DialogueBox.hx @@ -17,7 +17,7 @@ class DialogueBox extends h2d.Object { if (text == null) text = "NULL"; game = Game.current; - game.root.add(this, 1); + game.root.scene.getH2dObject().getScene().add(this, 1); bg = new h2d.ScaleGrid(Res.ui.toTile(), 5, 5, this); bg.colorKey = 0xFF00FF; tf = new h2d.Text(game.font, this); diff --git a/src/Game.hx b/src/Game.hx index 6ad44ca..5fc5c7a 100644 --- a/src/Game.hx +++ b/src/Game.hx @@ -8,9 +8,9 @@ import event.EventBus; import event.ChangeSceneEvent; import Const; -// import DialogueBox; -// import DialogueManager; -// import DialogueManager.Option; +import DialogueBox; +import DialogueManager; +import DialogueManager.Option; @:uiComp("game-container") class GameContainer extends h2d.Flow implements h2d.domkit.Object { @@ -69,19 +69,19 @@ class Game extends hxd.App { setGameScene(new TitleScene(root)); #end - // font = Res.font.minecraftia_regular_6.toFont(); - // font.resizeTo(24); - // - // dialogueManager = new DialogueManager(dialogue, renderActions); - // - // var yarnText = [ - // hxd.Res.text.intro.entry.getText(), - // ]; - // var yarnFileNames = [ - // hxd.Res.text.intro.entry.name, - // ]; - // dialogueManager.load(yarnText, yarnFileNames); - // dialogueManager.runNode("Intro"); + font = Res.font.minecraftia_regular_6.toFont(); + font.resizeTo(24); + + dialogueManager = new DialogueManager(dialogue, renderActions); + + var yarnText = [ + hxd.Res.text.intro.entry.getText(), + ]; + var yarnFileNames = [ + hxd.Res.text.intro.entry.name, + ]; + dialogueManager.load(yarnText, yarnFileNames); + dialogueManager.runNode("Intro"); } public function new() { @@ -98,52 +98,52 @@ class Game extends hxd.App { style.sync(); } - // function dialogue(manager:DialogueManager, t:String) { - // var d = new DialogueBox(Const.W, 100, t); - // d.y = 0; - // d.onClick = function() { - // manager.resume(); - // }; - // - // curDialogue = d; - // } - // - // function renderActions(manager:DialogueManager, t:Array