Archives by Month

November

2011

Corona SDK 05: Advanced Touch Handling – YouTube

I recently had to create a sliding menu for a game I am working on. Coming from a Flash background I usually think in terms of, “how would I do this in flash?”, and it translates really well. Same goes for the functionality that I came up with for the menu component that I created so the user can swip from left to right to get to the next set of buttons.

The difference in Corona and flash that I found was the way you listen for events on the “stage”. The following video has some great little bits of info for advanced touch event features and logic. The first tip solved the issue I was having and it only took adding a couple more lines of code.

Coronasdk development tip – suspend

In hopes to save someone else a few hours of reading and digging I figured I would start posting some quick tips about some of the small things that will make your programming experience on iOS with coronasdk a little easier and let’s face it, make you feel more awesome that your applications does what it’s supposed to do when a user interacts with it. 

If the user hits the home button on iOS the app closes and if they where in the middle of doing something, by default they will not be returned to that state in the app. Not sure why this is the default functionality but none the less I started searching on how to “save state” of the app when it’s interrupted by navigating to another application or clicking the home button to get back to the main screen. 

If you do some googling as I did for “saving state”, or “coronasdk suspend” and so forth you will more than likely come across a few posts that suggest listening for and event that the applications is exiting and then figuring out a way to save the state of all the variables and logic needed to load the screen the user is on when they return to the app. This is totally the case and something you should do if you want to return them to that state if the app quit but suspend is different that quitting or exiting the app all together. 

If you want the app to suspend and return to the screen and state that it’s in when the user navigates away and returns via “iOS multitasking” then the solution is very simple. Go into your app build.settings file and add the following line “UIApplicationExitsOnSuspend = false”. By default a corona app “Exits” the app when suspended by default. You are basically telling the app to suspend rather than exit by adding this to your build settings.

https://gist.github.com/1355130

If you are interested in taking this corse then submit your email. I'll make sure you get a discount for signing up early.