-
Notifications
You must be signed in to change notification settings - Fork 7.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Phaser doesn't take PixiJS resolution texture into account #1707
Comments
Ok, got it from there: #1621 You should update the book ;) It rises me an other issue, PixiJS only manages 1 and @2x ; so how could I manage many assets scales from [0.25,0.375,0.5,0.75,1] ; from iPhone 3GS, iPhone retina, iPhone 6(+), iPad retina... Obviously, I will put android devices resolutions close to the iOS one corresponding. Any ideas guys? @GoodBoyDigital @englercj Maybe we should add into Texture a scale. If Pixi's texture have a scale, it enables us to have the same image size no matter the image resolution used. Example : I designed my image for the iPad retina, it's 100 x 100. I defined it as a 4x. Does that make sense? At that time we're fighting fiercely with our more than 2 assets resolutions. |
-> Maybe a Texture could have a scale property (as well as resolution). if my source image represents a half scale asset, (low resolution texture) , I could tell Texture it has a scale of .5 . |
Hey there this has been addressed in v3 bg_zone_1@0.5x.png <- that would be a resolution of 0.5; |
Hi @GoodBoyDigital , Thanks for the reply, this is great news. if so this is amazingly helpful for multi-resolution/multi-device/multi-screen whatever we want to call it, as well as not having to just use letterbox mode or just scale everything with the game's resolution. my only wish would be to have resolution specifically aimed at using different assets for different screen pixel 'densities' if you will, and having a different factor with a different name , like "scale" which in that case is really about different screen or window or browser size and a scale for textures. It's the same in the end really (in fact they would be mulitplied together I guess) but the word "resolution" I find can be confusing when using this property for different purposes as it was designed for. So now I'd like to hear about Phaser and its position on this, as in my project as far as I can tell, this is not yet working (Phaser 2.3) I do see the pixi package having the right code for @2x for example (so older than v3) , in PIXI.BaseTexture.fromImage however this specific function is never called in my project - looking at Phaser.Loader/Phaser.Cache, it seems Phaser creates its BaseTextures/Texture in its own way - and just apparently not taking resolution of textures (into account. Please do correct me if I'm wrong, I've spent time looking at the source of master and dev branch as well but this must already be clear to frequent contributors. Confirming that it isn't available yet at least would let me know I'm not doing anything wrong - appart from reading the source code clearly wrong then which is very very likely. Anyway thank you very much for your time, have a nice day ! cc @photonstorm , |
yes, this is now how it now works :) different resolutions will always have the same width/ height once in pixi. |
I have no plans on addressing this in Phaser 2.x, sorry. It's too much of an internal change. If that means you need to build your game natively in Pixi 3 when it's released and stop using Phaser then I can fully understand that. Equally if someone wants to add the feature and submit a PR I'd be up for that too. |
Thanks for the clarification. We started looking into the Phaser core but it sounded complicated since we don't master yet the Phaser internal architecture. Unfortunately, we already spent lot of time on this multi scale assets subject. So we'll just use a scale factor everywhere for the moment, but I hope you plan to add this in Phaser 3. I think it's really important for :
Thanks again to both of you for your hard work. |
In order to keep the Github issues clear this feature request has been moved to the Phaser 3 wishlist. |
Hey there,
In PixiJS we have a resolution argument in its constructor so we can handle several assets size see the Resolution and Retina! part.
The Phaser.Game object doesn't offer this kind of functionality, so how could we handle multiple assets size without fighting on our side on different assets size / scale factor multiplication and so on... ?
The long story is on the forum.
Thanks.
The text was updated successfully, but these errors were encountered: