hollygood Posted November 19, 2015 Share Posted November 19, 2015 Hi, I'm a Phaser newbie here. I'm building a breakout game, and when the ball hits a specific brick, the game will be paused and a questionnaire form will appear, user needs to select the answer and submit the form. After the form submission, the game unpause and user goes back to the game again. My current solution is use a pop up window, and load an iframe for the form. I'm wondering if there are another possible solutions. Thanks in advance. Link to comment Share on other sites More sharing options...
pog Posted November 20, 2015 Share Posted November 20, 2015 I don't think you can do this with Phaser but using HTML5 and JavaScipt you could create a modal div that displays and hides when you need it. jQuery is able to do this with jQuery UI. http://jqueryui.com/dialog/#modal-message Tilde 1 Link to comment Share on other sites More sharing options...
san40511 Posted November 20, 2015 Share Posted November 20, 2015 you need create 2 transparent markers with help game.add.sprite(x,y,sprite). 1 in the left top point and 2-nd in the right-bottom. After that you can fast calculate where must be your html box. This is code from my current project enableGui : function (ctx,marker,marker2) { this._marker = marker; this._marker2 = marker2; var gameHeight = ctx.height, gameWidth = ctx.width, gamePositionX = ctx.canvas.offsetLeft, markerOneX = marker.position.x, markerOneY = marker.position.y, markerTwoX = marker2.position.x, markerTwoY = marker2.position.y; this.$el.css({ width : gameWidth-markerOneX-(gameWidth-markerTwoX), height : gameHeight-markerOneY-(gameHeight-markerTwoY), top : markerOneY+'px', left : gamePositionX+markerOneX+'px', zIndex : 8, position: "absolute" });}, this.$el = this is your html block where will be your form Link to comment Share on other sites More sharing options...
Recommended Posts