Sulaiman Khan
Sulaiman Khan

Reputation: 908

Corona SDK Runtime Error on version 3.0.0

I used a Older Corona SDK but i installed recent version 3.0.0 . When is tried to use stateText:setReferencePoint(display.CenterReferencePoint); it shows following runtime error! in newer version Corona SDK. What's the problem? can anyone suggest me any solution? Image of my Error

Upvotes: 0

Views: 137

Answers (1)

Rob Miracle
Rob Miracle

Reputation: 3063

First, Corona SDK version numbers are something like the year and a four digit build number. The current public build for instance is 2014.2189, so I don't' know what 3.0.0 is. But that said,

:setReferencePoint() was an API in our older Graphics 1.0 based engines (build numbers less than 2000). They have been replaced by Anchor Points in Graphics 2.0 based builds (build numbers 2000 and greater).

You have two choices. If you want to continue to use :setReferencePoint() you must add this to your config.lua where you set the width and height:

graphicsCompatibility = 1,

Or you can switch to using AnchorPoints. See the tutorial: http://coronalabs.com/blog/2013/10/15/tutorial-anchor-points-in-graphics-2-0/

Upvotes: 1

Related Questions