This tutorial explains how to wrap your iPhone applications screen.
Is that the right terminology? I have no idea. It has something to do with wrapping something. Now my mind is stuck on all the Christmas wrapping I need to do. Dammit.
Anyway, I don’t have long, it’s been a killer day and I have more to do yet, but this tutorial is just a basic little thing like I used on the hero star character in Happy Doodle Sushi Smile. (Yup, it’s in bold because it’s important! :P)
Copy the text below and place it into your file, immediately underneath the code you used to set up your hero/main “actor”. (I know we don’t call them actors in Corona, but I do.)
local function wrap (event)
if heroright.x < 0 then heroright.x = 310 end if heroright.x > 310 then
heroright.x = 0
Next up; We need to fix the hero’s name. Mine is “heroright” which is a terrible name but I was too lazy to change it and now have continued to use it in HDSS 1.5 which is currently awaiting release pending Apple’s approval.
So, either manually go through and change “heroright” to “myhero” or “hero” or “imsuperawesome” or whatever you have named it, or use Ctrl+f then simply type in the find box “heroright” and below in the replace with box type in your hero’s name. Either or.
Notes: This is set up for an app running in portrait mode and only wraps on X (left and right) – so if you want it all wrapped you’ll want to do the same for Y (up and down). Ask me if you need help, as per usual!
I hope this helps some of you – sorry it’s not quite the same super professional style I usually go for (eh hem :P) but I’m currently exhausted after being on my feet all day.
Enjoy, more to come!