Jump to content

Image not displaying


Recommended Posts

I have two images that I want to display, but there's some error. I'm just getting green boxes in place of the images. I checked the paths. They are correct. What might be the issue?

I have attached a screenshot.


You can view the screenshot of the console here : https://www.dropbox.com/s/1puzi0mci2m1535/Capture.PNG?dl=0

My JS code:


var GameState = {    preload: function() {        this.add.image('bg','Assets/Images/stormy-sky.png');        this.add.image('sea','Assets/Images/sea.png');        this.add.image('ship','Assets/Images/Ship.png');    },    create: function() {        this.background = this.game.add.sprite(0,0,'bg');        this.sea = this.game.add.sprite(0,300,'sea');    },    update: function() {    }};var game = new Phaser.Game(640,360,Phaser.AUTO);game.state.add('GameState',GameState);game.state.start('GameState');


Link to comment
Share on other sites


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...