[urgent!] HELP PLEASE! Graphics v2

Hey guys my name is Brady and I am a new developer. I have spend some time researching this engine and I have built my first game. But, I took a break for a bit and now corona has been updated. I have tried peoples suggestions on how to update my game.lua codeing but something’s amiss. Please Recode this to work in v2 Graphics, I will forever be in your debt.

I changed the file extension so I could upload :stuck_out_tongue_winking_eye:

I will also (if you leave your full name) put your name in the game description on the app stores!

At first glance your main problem is that setReferencePoint is deprecated. 

So wherever you have

[lua]someObject:setReferencePoint(display.BottomLeftReferencePoint)[/lua]

replace with:

[lua]someObject.anchorX = 0

someObject.anchorY = 1

[/lua]

and see how that goes.

The sprite.* API is also gone in G2. It’s built-in to the standard display.* API nowadays.

You’ll need to migrate to display.newSprite instead.

That fixed some issues But, Now these lines are giving me issues, specifically the first line:

    jetSpriteSheet = display.newSprite(“jet.png”, 50, 17)
    jetSprites = display.newSprite(jetSpriteSheet, 1, 4)
    sprite.add(jetSprites, “jets”, 1, 4, 1000, 0)

I have fixed this now thanks for the Help but, now I have the issue as stated above


Corona Runtime Error

c:\users\bdogup\desktop\games\city jets\game.lua:55: bad argument #1 to ‘newSprite’ (ImageSheet expected, got string)
stack traceback:
 [C]: ?
 [C]: in function ‘newSprite’
 c:\users\bdogup\desktop\games\city jets\game.lua:55: in function <c:\users\bdogup\desktop\games\city jets\game.lua:11>
 ?: in function ‘dispatchEvent’
 ?: in function ‘gotoScene’
 c:\users\bdogup\desktop\games\city jets\Start.lua:26: in function <c:\users\bdogup\desktop\games\city jets\Start.lua:24>
 ?: in function <?:218>

Do you want to relaunch the project?

Yes   No  

This is the error it gives me. I have no idea what is going on. I would so appreciate it if someone just recoded for me! Someone who knows this new system better than I do XD

As you can see in the documentation for display.newSprite you have to provide an image sheet not a file name for this function

http://docs.coronalabs.com/api/library/display/newSprite.html

You can learn how to create an image sheet here:

http://docs.coronalabs.com/api/library/graphics/newImageSheet.html
 

I will also (if you leave your full name) put your name in the game description on the app stores!

At first glance your main problem is that setReferencePoint is deprecated. 

So wherever you have

[lua]someObject:setReferencePoint(display.BottomLeftReferencePoint)[/lua]

replace with:

[lua]someObject.anchorX = 0

someObject.anchorY = 1

[/lua]

and see how that goes.

The sprite.* API is also gone in G2. It’s built-in to the standard display.* API nowadays.

You’ll need to migrate to display.newSprite instead.

That fixed some issues But, Now these lines are giving me issues, specifically the first line:

    jetSpriteSheet = display.newSprite(“jet.png”, 50, 17)
    jetSprites = display.newSprite(jetSpriteSheet, 1, 4)
    sprite.add(jetSprites, “jets”, 1, 4, 1000, 0)

I have fixed this now thanks for the Help but, now I have the issue as stated above


Corona Runtime Error

c:\users\bdogup\desktop\games\city jets\game.lua:55: bad argument #1 to ‘newSprite’ (ImageSheet expected, got string)
stack traceback:
 [C]: ?
 [C]: in function ‘newSprite’
 c:\users\bdogup\desktop\games\city jets\game.lua:55: in function <c:\users\bdogup\desktop\games\city jets\game.lua:11>
 ?: in function ‘dispatchEvent’
 ?: in function ‘gotoScene’
 c:\users\bdogup\desktop\games\city jets\Start.lua:26: in function <c:\users\bdogup\desktop\games\city jets\Start.lua:24>
 ?: in function <?:218>

Do you want to relaunch the project?

Yes   No  

This is the error it gives me. I have no idea what is going on. I would so appreciate it if someone just recoded for me! Someone who knows this new system better than I do XD

As you can see in the documentation for display.newSprite you have to provide an image sheet not a file name for this function

http://docs.coronalabs.com/api/library/display/newSprite.html

You can learn how to create an image sheet here:

http://docs.coronalabs.com/api/library/graphics/newImageSheet.html