var FilePackObject = { "pack": { "files": [ { "type": "texture", "key": "labs", "url": { "ASTC": "assets/compressed/labs-astc-4x4.pvr", "ETC1": "assets/compressed/labs-etc1.pvr", "PVRTC": "assets/compressed/labs-pvrtc-4bpp-rgba-srgb.pvr", "S3TC": "assets/compressed/labs-bc3.pvr", "IMG": "assets/compressed/labs.png" } } ] }, "meta": { "generated": "1401380327373", "app": "Phaser 3 Asset Packer", "url": "https://phaser.io", "version": "1.0", "copyright": "Photon Storm Ltd. 2021" } }; class Demo extends Phaser.Scene { constructor () { super(); } preload () { this.load.setBaseURL('https://cdn.phaserfiles.com/v355'); this.load.pack('pack1', FilePackObject); } create () { const logo = this.add.image(400, 300, 'labs'); this.add.text(400, 570, logo.frame.source.compressionAlgorithm).setOrigin(0.5, 0); } } const config = { type: Phaser.AUTO, parent: 'phaser-example', width: 800, height: 600, backgroundColor: '#2d2d6d', scene: Demo }; const game = new Phaser.Game(config);
Scan to open on your mobile device
var FilePackObject = { "pack": { "files": [ { "type": "texture", "key": "labs", "url": { "ASTC": "assets/compressed/labs-astc-4x4.pvr", "ETC1": "assets/compressed/labs-etc1.pvr", "PVRTC": "assets/compressed/labs-pvrtc-4bpp-rgba-srgb.pvr", "S3TC": "assets/compressed/labs-bc3.pvr", "IMG": "assets/compressed/labs.png" } } ] }, "meta": { "generated": "1401380327373", "app": "Phaser 3 Asset Packer", "url": "https://phaser.io", "version": "1.0", "copyright": "Photon Storm Ltd. 2021" } }; class Demo extends Phaser.Scene { constructor () { super(); } preload () { this.load.setBaseURL('https://cdn.phaserfiles.com/v355'); this.load.pack('pack1', FilePackObject); } create () { const logo = this.add.image(400, 300, 'labs'); this.add.text(400, 570, logo.frame.source.compressionAlgorithm).setOrigin(0.5, 0); } } const config = { type: Phaser.AUTO, parent: 'phaser-example', width: 800, height: 600, backgroundColor: '#2d2d6d', scene: Demo }; const game = new Phaser.Game(config);