Search the Community
Showing results for tags 'div'.
-
Good afternoon everyone, I'm having some problems fitting Phaser inside a responsive div. I have already achieved this with bootstrap, but this project requires flexbox -- and it's not working as intended. I have noticed that when Phaser is injected in a div inside a flexbox container, the resize event is not fired when the window changes size. I have tried fitting it in a div with "position: absolute" that follows x, y, width and height properties of the flexbox item, but with no success. Has anyone tried this before? Maybe it's something trivial that I'm missing. Thanks in advance, Pedro Antoninho
-
- responsive
- css
- (and 4 more)
-
Hi Can I use divs as virtual controls? I have a div called "leftButton" and I want you to hold down the function "turnLeft()" is executed.The idea is that the vehicle turn left while the div is pressed. URL Test var interval; $("#leftButton").mousedown(function () { interval = setInterval(function() { game.state.states.main.turnLeft(); }, 50); }).mouseup(function () { clearInterval(interval); });On mobiles, currently the operation is not correct, since a delay or the car continues to rotate indefinitely occurs.Desktop works by pressing the div with the mouse.My goal is to use divs for the interface (Buttons, records, lives, etc.), around the game screen. Kind regards PD. Sorry for my English language