PNG not rgb


I’m stuck, I don’t know what to do. On my app project I’m only using png’s so when the player goes to the Options page to select purpleBall.png or fireBall.png or iceBall, what would be the code for that png ball to appear on level 1?

So Options page select ball then it’s there on level 1 and through out the game. I’m lost.

Appreciate any help


Im not sure this is what you meen. However, one approach to do this is just save players choice somewhere (to file, to variable…) and then load proper ball when creating level 1.

I would like to help you but I have no clue what you are talking about…

What are you trying to do? What is not working?

Maybe you can provide som code example?

Hi @DLuck,

May be read Corona pass parameter in gotoScene

Have a nice day:)

Create a file called myData.lua as follows:

return {}

At the top of your options file put:

local myData = require "myData"

At the top of your level1 file put:

local myData = require "myData"

In your options file, where ever you select the image file put:

myData.imageFile = "purpleBall.png"

Or, whichever file name is appropriate. In your level1 file, when you create the image put:

ball = display.newImage(myData.imageFile)

That should achieve what you are trying to do.