The error i’m recieving is “object:setReferencePoint() is only available in graphicsCompatibility 1.0 mode. Use anchor points instead”. I haven’t been programming for very long, and so I have absolutely no idea how to fix this error. Any help is appreciated
Where did you get the code that produces that error? Please provide link(s).
That code is from the graphics 1.0 version of Corona which stopped being a thing many years ago. i.e. Your example/source is very old.
You’re best off throwing away the example and getting something more modern.
the link to the page is: https://www.raywenderlich.com/2792-how-to-make-a-breakout-game-with-corona
it’s a school task, so i can’t exactly update my source material. I’m working on a 2017 build of corona, again, because the school requires it. the section on that website that creates the error is section 19, “killing zombies and padding stats” in the line that contains “zombieKillNum:setReferencePoint(display.CenterLeftReferencePoint);”.
Sorry if i missed anything
You have very OLD code which is supported on Graphics 1.0.
Now Solar2D (formerly Corona SDK) supports Graphics 2.0
So you need to update All :setReferencePoint() method with
object.anchorX & object.anchorY.
For Eg.
zombieKillNum:setReferencePoint(display.CenterLeftReferencePoint);
change to :
zombieKillNum.anchorX=0
and object:setTextColor() & object:setLineColor() should be --> object:setFillColor()
You can find more details about object anchor points here :
https://docs.coronalabs.com/guide/graphics/transform-anchor.html
You can find the OLD document for Migrafration from Graphics 1.0 to Graphics 2.0 here:
https://web.archive.org/web/20150415124928/http://docs.coronalabs.com/guide/graphics/migration.html
To reiterate what the others have said, any sample using graphics 1.0 is very old. Corona changed to using graphics 2.0 back in 2013 and a lot has changed since then.
While many parts of the sample are likely to be fine, you’ll have to spend ages making annoying little tweaks to account for changes to Solar/Corona in that time. Finding a newer sample to work from would be a much better starting point.
That is weird. Your school needs to update to latest Corona.
While you might be able to run an old copy of Corona SDK on your machine, you won’t be able to make a (store) distributable (mobile) game with it.
Note: I have a free breakout example that should be fully compatible with modern Corona.
All Products On GitHub
** Breakout specifically**
Post about about my free templates++ here:
Thank you for your help. I tried it out, and it seems to work, however I believe that i’m going to have to make some adjustments to the code that I am using to get it to work properly, but thank you got helping me figure it out.