Jump to content

Fullscreen onInputDown issues


Brandybuck
 Share

Recommended Posts

Hey Guys,

 

I'm new to Phaser and can't wrap my head around something!

That's to say, i'm not sure whether i've found a bug or doing something wrong..

 

Right now i've got this game that wants to go fullscreen.

define(function(){	var p = Main.prototype;  	Main.game = null;  Main.juggler = [];	function Main()	{    Main.game = new Phaser.Game(568, 320, Phaser.AUTO, 'holder', { preload: this.preload, create: this.create, update: this.update });    g.game = Main.game	}	p.preload = function()	{    Main.game.load.bitmapFont('orangejuice', 'fonts/orangejuice.png', 'fonts/orangejuice.xml');		Main.game.load.image("curtain", "images/curtain.png");    Main.game.load.image("bg-cage", "images/bg-cage.png");    Main.game.load.image("title", "images/title.png");    Main.game.load.image("btn-start", "images/btn-start.png");    Main.game.load.image("tassel", "images/tassel.png");	}	p.create = function()	{    		//Main.game.input.onDown.add(function(){		//	Main.game.stage.scale.startFullScreen();		//}, this);        Main.game.stage.scaleMode = Phaser.StageScaleMode.SHOW_ALL; //resize your window to see the stage resize too    Main.game.stage.scale.setShowAll();    Main.game.stage.scale.refresh();        new Splash();	}	p.update = function()	{	  for(key in Main.juggler)      Main.juggler[key]();	}    g.Main = Main;  new Main();  });

When I un-comment that bit of code, the game enters fullscreen as soon as you click it.

(I know that's bad practice, but it's easier to debug this way)

 

Now, in my Splash class I create a single button that will trigger something.

define(function(){    var p = Splash.prototype;  function Splash() {    this.tassel = Main.game.add.sprite(0,0,"tassel");    this.tassel.inputEnabled = true;    this.tassel.events.onInputDown.add(this.onTasselClicked, this);  }  p.onTasselClicked = function(){    alert("you clicked me!");  }})

However, when i'm in fullscreen mode, i can't exactly click the button.

 

The hitbox for the onInputDown event stays where it was before going fullscreen. So clicking the actual sprite doesn't trigger anything, but clicking the area where the sprite used to be does.

 

Is this a bug or am i missing something?

Link to comment
Share on other sites

Could you please submit a github issue for this? (ideally with a little compact code example) as I'm 90% sure it's an issue we'll need to investigate, rather than being something wrong with your code. I know it's a bit of a pain having to repost this on github, but it's really really helpful for us :)

Link to comment
Share on other sites

  • 2 weeks later...

I experience the same issue. Sprite click event stops working after entering fullscreen and even after going back to "windowed" mode.

 

UPD: Seems to come out only when scaling/distortion is applied. When the canvas is resized and not scaled/distorted, everything works as it should.

Link to comment
Share on other sites

  • 4 months later...
  • 4 months later...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...