iPhone Build not picking up BackGround Image.png

Hello everyone, 

Some issue cannot figure out, I run my program in the corona simulator all is well, when I build it for the iPhone

my backGround Image is not being picked up. Only my buttons are showing. Below is some separation code. 

I even tried just using the image out of the folder it still does not work. Must be something else I am missing. 

Any Help is much appreciated. 

if (display.pixelHeight == 960) then

               isIPhone4 = true

               SplashImage = display.newImage(“BTestBackGrounds/timerBG640960.png”)

          

       elseif (display.pixelHeight == 1136) then

               isIPhone5 = true

                SplashImage = display.newImage(“BTestBackGrounds/timerBG6401136.png”)

            

       elseif (display.pixelHeight == 1334) then

            isIPhone6 = true

            SplashImage = display.newImage(“BTestBackGrounds/timerBG7501334.png”)

end

   SplashImage.anchorX = 0

   SplashImage.anchorY = 0

   SplashImage.xAlign = contentWidth

  SplashImage.yAlign = contentHeight

                        sceneGroup:insert(SplashImage)

Regards

JZ

My guess is you’re goofing up upper- or lower-case somewhere.

I suggest the following as a naming convention:

  • file names - All lowercase.  

    • Ex: myimage.png NOT MyImage.png
  • variable names and function names -  Camel Case.   

    thisIsCamelCase = 10

Note: 99% of the time, when a file can’t be found, it is because you’ve used mismatching cases.

Great ! thanks for the info, I know it was a bit sloppy, however there are no spelling errors. I check a few times. I took the image reference out of the folder it is not displaying. Like I said it works fine on the corona simulator but not the device or the iPhone simulator. 

Any other ideas ?

Regards 

JZ 

Hi again, Okay something is weird…

This does not even work      

 local menuBG = display.newImageRect(“timerBG6401136.png”,640,1136)

  menuBG.anchorX = 0

menuBG.anchorY = 0

menuBG.x = 0

menuBG.y = 0

But this does…                    

                                             local myCircle = display.newCircle( 100, 100, 30 )

                                              myCircle:setFillColor( 0.5 )

                                               myCircle.strokeWidth = 5

                                              myCircle:setStrokeColor( 1, 0, 0 )   

One of the problems in supporting this is we can’t see where your files are and what they are really named.

In your first example, you’re trying to load photos from a folder named: BTestBackGrounds

In your second example that you’re saying isn’t working, you are not trying to load it from the same folder.   If your images are in a sub-folder, you have to include the folder name as part of the filename.

Now back to your original post.  Just to make sure you understand in the simulator:

filename.PNG and filename.png and Filename.png and fIleNAME.PnG

are the same file.  On devices they are all different file names.  You need to make sure the file names match exactly.   If it’s not working, you need to look at your device’s console.log and see if you getting any warning or error messages.  If you need help with that see:

http://coronalabs.com/blog/2013/07/09/tutorial-basic-debugging/

Rob

My guess is you’re goofing up upper- or lower-case somewhere.

I suggest the following as a naming convention:

  • file names - All lowercase.  

    • Ex: myimage.png NOT MyImage.png
  • variable names and function names -  Camel Case.   

    thisIsCamelCase = 10

Note: 99% of the time, when a file can’t be found, it is because you’ve used mismatching cases.

Great ! thanks for the info, I know it was a bit sloppy, however there are no spelling errors. I check a few times. I took the image reference out of the folder it is not displaying. Like I said it works fine on the corona simulator but not the device or the iPhone simulator. 

Any other ideas ?

Regards 

JZ 

Hi again, Okay something is weird…

This does not even work      

 local menuBG = display.newImageRect(“timerBG6401136.png”,640,1136)

  menuBG.anchorX = 0

menuBG.anchorY = 0

menuBG.x = 0

menuBG.y = 0

But this does…                    

                                             local myCircle = display.newCircle( 100, 100, 30 )

                                              myCircle:setFillColor( 0.5 )

                                               myCircle.strokeWidth = 5

                                              myCircle:setStrokeColor( 1, 0, 0 )   

One of the problems in supporting this is we can’t see where your files are and what they are really named.

In your first example, you’re trying to load photos from a folder named: BTestBackGrounds

In your second example that you’re saying isn’t working, you are not trying to load it from the same folder.   If your images are in a sub-folder, you have to include the folder name as part of the filename.

Now back to your original post.  Just to make sure you understand in the simulator:

filename.PNG and filename.png and Filename.png and fIleNAME.PnG

are the same file.  On devices they are all different file names.  You need to make sure the file names match exactly.   If it’s not working, you need to look at your device’s console.log and see if you getting any warning or error messages.  If you need help with that see:

http://coronalabs.com/blog/2013/07/09/tutorial-basic-debugging/

Rob