How do I upgrade to corona 2.0 graphics comparability?

Hey,

I’ve been using corona to make a couple of games so far. Everything was working fine until today. When I ran my game, I got this error in the console window: 

12:07:28.395  WARNING: V1 graphics compatibility is deprecated. Some features may not work as expected

https://coronalabs.com/blog/coronageek/corona-geek-hangout-64/

I read on this blog post that there is an update to corona graphics 2.0 from 1.0. However, whenever I try to click on the “Graphics 2.0 Migration Guide” it just takes me to the corona docs page: https://docs.coronalabs.com/.

Could you please let me know if there is a guide to updating my graphics?

The following is a code from my config file for the graphics settings:

content =

{

graphicsCompatibility = 0,

width = 768,

height = 1024, 

–scale = “adaptive”

scale = “letterBox”,

fps = 60,

imageSuffix =

{

   ["@2x"] = 2,

},

},

Thanks,

Suhas

Maybe this Fast migration of Graphics 1.0-based projects to Graphics 2.0 andAdd support for newer plugins to Corona Simulator (legacy) help you

This turns on Graphics 1.0 Compatibility mode

graphicsCompatibility = 1

You may need those

https://github.com/coronalabs/framework-sprite-legacy

https://github.com/coronalabs/framework-storyboard-legacy

Also read 

Deprecated Errors when running Corona Simulator

Generate APK file with 2013.1076 version

To switch it to V2, it largely depends on the complexity. If you don’t have storyboard or sprite, I largely found it was removing the deprecated setxxxxcolor and switching it. (Adding /255 when changing the colours to something e.g.: 174/255)

Setreferencepoint was also removed, so there you switch it to AnchorX and AnchorY. The value you use is dependant on where the ref point was.

That got a lot of ‘examples’ working. 

That said, graphicsCompatibility = 1 is a heck of a lot easier :slight_smile:

Thanks for reply. I changed my config file to the code below and I still get the same error. Any clue what I might be doing wrong? I have tried creating a blank project with the same config file and it gives me the same error. However, when I make the graphicsCompatibility = 0, I get no error now. 

content = { graphicsCompatibility = 1, width = 768, height = 1024,  --scale = "adaptive" scale = "letterBox", fps = 60, imageSuffix = {    ["@2x"] = 2, }, },

The error message:

16:13:24.782  WARNING: V1 graphics compatibility is deprecated. Some features may not work as expected

16:13:24.782  WARNING: V1 graphics compatibility is deprecated. Some features may not work as expected

As you can see, this is a warning not an error. Because you have graphicsCompatibility set it’s warning you of possible unpredictable results. you can run with a warning.

Just wanted to post an update.

I took Idurniat and graham07’s advice and used graphicsCompatibility = 1. 

I still get the warning message but everything seems to be working fine for me. Thanks for all your help guys :)!

I have been using graphicsCompatibility = 1 since it was first released and all works fine in my app. Now there is a warning I worry that maybe in the future even graphicsCompatibility = 1 will be depricated -Need I?

Personally, I would not rely on “backwards compatibility” going forward as this could very easily be removed.  

Simply change your values from 0-255 to 0-1 (/255 if you have to) and anchor all your assets at the centre of the asset and you should be good to go.

Maybe this Fast migration of Graphics 1.0-based projects to Graphics 2.0 andAdd support for newer plugins to Corona Simulator (legacy) help you

This turns on Graphics 1.0 Compatibility mode

graphicsCompatibility = 1

You may need those

https://github.com/coronalabs/framework-sprite-legacy

https://github.com/coronalabs/framework-storyboard-legacy

Also read 

Deprecated Errors when running Corona Simulator

Generate APK file with 2013.1076 version

To switch it to V2, it largely depends on the complexity. If you don’t have storyboard or sprite, I largely found it was removing the deprecated setxxxxcolor and switching it. (Adding /255 when changing the colours to something e.g.: 174/255)

Setreferencepoint was also removed, so there you switch it to AnchorX and AnchorY. The value you use is dependant on where the ref point was.

That got a lot of ‘examples’ working. 

That said, graphicsCompatibility = 1 is a heck of a lot easier :slight_smile:

Thanks for reply. I changed my config file to the code below and I still get the same error. Any clue what I might be doing wrong? I have tried creating a blank project with the same config file and it gives me the same error. However, when I make the graphicsCompatibility = 0, I get no error now. 

content = { graphicsCompatibility = 1, width = 768, height = 1024,  --scale = "adaptive" scale = "letterBox", fps = 60, imageSuffix = {    ["@2x"] = 2, }, },

The error message:

16:13:24.782  WARNING: V1 graphics compatibility is deprecated. Some features may not work as expected

16:13:24.782  WARNING: V1 graphics compatibility is deprecated. Some features may not work as expected

As you can see, this is a warning not an error. Because you have graphicsCompatibility set it’s warning you of possible unpredictable results. you can run with a warning.

Just wanted to post an update.

I took Idurniat and graham07’s advice and used graphicsCompatibility = 1. 

I still get the warning message but everything seems to be working fine for me. Thanks for all your help guys :)!

I have been using graphicsCompatibility = 1 since it was first released and all works fine in my app. Now there is a warning I worry that maybe in the future even graphicsCompatibility = 1 will be depricated -Need I?

Personally, I would not rely on “backwards compatibility” going forward as this could very easily be removed.  

Simply change your values from 0-255 to 0-1 (/255 if you have to) and anchor all your assets at the centre of the asset and you should be good to go.