phaserjs / phaser-ce

Phaser CE is a fun, free and fast 2D game framework for making HTML5 games for desktop and mobile web browsers, supporting Canvas and WebGL rendering.
http://phaser.io
MIT License
1.35k stars 491 forks source link

Add check if webp images are supported #438

Open vforsh opened 6 years ago

vforsh commented 6 years ago

Please add the check for webp image format. It becomes more and more popular. Something like game.device.webp will be great.

For example, this is how Modernizr performs such check - https://github.com/Modernizr/Modernizr/blob/master/feature-detects/img/webp.js

samme commented 6 years ago

There would be a small time cost to loading the image.

The implementation would also be a little challenging because none of Phaser.Device's tests are asynchronous, like this one.

ankush-badyal commented 6 years ago

Does Phaser-ce support webp or other latest image formats?

samme commented 6 years ago

That would depend on the browser's support for WebP.

oktayacikalin commented 6 years ago

I think it would make sense to have an automatism in the atlas loader, which would either load the webp or other format.