Resize method not firing? At all?

Recommended Posts

Hey, I'm kind of stuck trying to work out what's happening with my game.  I've been having issues getting my game responsive, so I tried... well, everything I can think of, really.  I've brought my game all the way down to four near-empty files; boot.js, preload.js, menu.js and app.js, and I'm getting nothing on resize events.

I'm using Phaser 2.6.2, I've got "this.scale.setMode = Phaser.ScaleManager.RESIZE" in my boot.js's init function, I've got a resize handler in my menu just titled 'resize' with nothing but "console.log('resize')" inside of it, and nothing happens on resize.  I don't understand at all.  I found a guide someone put together that has really similar architecture to my project (http://www.netexl.com/blog/making-of-a-responsive-game-in-phaser-part-2/) and even looking at that person's game.js in dev tools and comparing against my game, I can't see how we differ (outside of me keeping my various methods in separate files) or how I've screwed up.  Resize just plain doesn't fire on my project, even when it's as simple as logging something to console.  Note: I'm able to get other things to log to console just fine, it's just that the resize method doesn't do what it's supposed to do.

I'd like to be able to show the whole code for my project if possible, but I fully understand why that's not - if it helps, I can stick all my barebones stuff into a single file and huck it up on jsbin or something similar.  Still - does anyone have any clue where I could start looking as to why setting my ScaleManager to RESIZE doesn't fire my resize command?

Share this post

Link to post
Share on other sites

sorry guys in my opinion this methods is so expencive, recalculate the scale of all sprites... could you have another strategy to scale entire canvas?.... @whalleyrulz could you give and examples?...I need scale and resize my entire game in differents screens..please help me I prove alll escenarios and doesnt work thanks.


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.