whoami Posted April 13, 2017 Share Posted April 13, 2017 <!DOCTYPE html> <html> <head> <title></title> <script src="//cdn.jsdelivr.net/phaser/2.6.2/phaser.js"></script> </head> <body> <script> var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update }); function preload(){ game.load.image('loading','assets/preloader.gif'); } function create(){ var preloadSprite=game.add.sprite(0,0,'loading'); game.load.setPreloadSprite(preloadSprite); } function update(){} </script> </body> </html> why setPreloadSprite doesn't work Quote Link to comment Share on other sites More sharing options...
ivanix Posted April 13, 2017 Share Posted April 13, 2017 Just a wild guess but I thinks that preload and create are undefined when Phaser.Game() is called. Move var game = ... line to the bottom. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.