whalleyrulz Posted October 3, 2017 Share Posted October 3, 2017 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? Link to comment Share on other sites More sharing options...
samid737 Posted October 4, 2017 Share Posted October 4, 2017 this.scale.scaleMode //instead of setMode ? whalleyrulz 1 Link to comment Share on other sites More sharing options...
whalleyrulz Posted October 4, 2017 Author Share Posted October 4, 2017 samid737, you're my hero and also I feel like the biggest idiot. Why are all of the problems I have the hardest time resolving something unbelievably simple to fix. I feel so dumb right now! Thank you so much, this has worked perfectly. samid737 1 Link to comment Share on other sites More sharing options...
luisb Posted March 9, 2018 Share Posted March 9, 2018 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. Link to comment Share on other sites More sharing options...
Recommended Posts