var game =new Phaser.Game(375,667,Phaser.AUTO); var helloState={ preload:function (){ game.stage.backgroundColor="#a8d4bf" game.load.image("logo","/source/logo.png") }, create:function (){ var text=game.add.text(game.world.centerX,25,"hello world11",{fill:'#fff'}) text.anchor.set(0.5); var logo=game.add.image(game.world.centerX,game.world.centerY,"logo") logo.anchor.set(0.5); } } game.state.add("helloState",helloState); game.state.start("helloState");
已经看见你评论了很多,特意在这回一条,加油,在慕课网一起进步。还有学完了,来个中肯评价?
图片在哪里加载完成的?
你的背景图片没加载,你就一个hellostate。