Cannot load image?

HI everybody,

I cannot seem to display an image to the corona simulator.

Here is my script:


– main.lua


–  local myImage = display.newImage( “dog” )

Nothing shows up/no error messages.

The pic is png and is in the same folder as my main.lua script.

I have tried renaming the file dog.png,saving and relaunching the project.

Please could someone guide me in the right direction?

Thanks.

  1. dog.png, not dog with no extension

  2. Also be sure the file cases match (file name must be referred to in same case): dog.png ~= Dog.PNG

    local myImage = display.newImage( “dog.png” )

PS - I am assuming the file is an actual PNG.  You can’t start with a BMP, rename it to PNG and hope that works.  I’m sure you’re not doing this, but I’ve seen folks do it before so just in case…

Also, make sure to remove the two dashes, --, in front of the line that’s calling the image. The two dashes represents a comment in Lua and the simulator will not run commented out lines. 

  1. dog.png, not dog with no extension

  2. Also be sure the file cases match (file name must be referred to in same case): dog.png ~= Dog.PNG

    local myImage = display.newImage( “dog.png” )

PS - I am assuming the file is an actual PNG.  You can’t start with a BMP, rename it to PNG and hope that works.  I’m sure you’re not doing this, but I’ve seen folks do it before so just in case…

Also, make sure to remove the two dashes, --, in front of the line that’s calling the image. The two dashes represents a comment in Lua and the simulator will not run commented out lines.