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.

Daily build Widget 0.2.1 (BETA) is out for coronasdk

Coming in the next daily build (2011.645—should be up around 2am on the 25th of October), is a MAJOR update to the widget library.

The documentation pages have already been updated to reflect the changes, and I recommend viewing the list of "Known Issues" and "Recent Changes" to become familiar with this update.
http://developer.anscamobile.com/content/widget

Here are the main changes:

 

tableViews and scrollViews

These have been completely redesigned for stability and flexibility. Those who had problems with the tableViews before should immediately notice that there is no more losing rows, no more strange issues with category items, and now, you are completely free to decide WHAT goes in each row.

Each row, to include category items, are just another display group. You'll decide what goes into each row by specifying an 'onRender' listener for each row and inserting objects into the listener's event.view property. This means there's a little more "setup" involved when it comes to creating tableViews, but you are now given a tremendous amount of flexibility that was not possible before.

During testing, we've noticed that on older devices (which include 2nd generation iPod touches and older), tableViews with 500+ rows (or just a huge amount) do tend to stutter and cause some problems. It's not very user-friendly to have that many rows in a tableView anyway, so we recommend splitting up your lists by having a 'Load 25 More' row as the last item.

While the scrollView hasn't changed all that much, the parameters have been made to be more consistent with the tableView (as well as the other widgets), and an unfortunate side effect to all the refinements of this update is the absence of scrollBars (same goes for tableViews). Please be patient as we're working on restoring these in a future update. Until then, please enjoy the enhanced stability and flexibility these widgets now provide.

 

pickerWheel

Since the pickerWheel actually relies heavily on the tableView widget, we had to revamp this widget as well. You'll notice there's more customization options and no more limit to how many rows you can have. We've also added an "alignment" and "startIndex" property to each column.

Currently, there are two known issues that we're working on addressing in a future update. The first one is the fact that rows do not soft-land on specific items (as they do with the native iOS pickerWheel). The selected item will be whatever is in the selection area, whether it is centered or not.

The second known issue is that if you change the 'y' value of the pickerWheel (such as with a transition.to, to slide the pickerWheel up), then the 'getValue()' method will stop working. We recommend you instead "fade" the pickerWheel in if you want some kind of animation, as you cannot move the pickerWheel once it has been created without experiencing issues.

 

tabBar (brand new widget)

This is the much-requested tabBar widget that is brand new to this upcoming version of the widget library. It supports plenty of customization and an unlimited amount of tab buttons.

For iOS users, the default tabBar should look and feel just-right. For other platforms, or apps that need to deviate from the standard look, there are plenty of parameters you can set to get it looking just the way you want.

Here is the API documentation for the new tabBar:
http://developer.anscamobile.com/reference/index/widgetnewtabbar

 

Widget Themes

Prior to this version, themes were hard-coded into the widget library and relied on updates to provide you with new themes. That is no longer the case.

Now, themes are Lua modules which contain tables (similar to config.lua) that correspond to specific widgets. Since widgets have been made to be more flexible, themes are simply preset parameters for the widget (that you can override on a per-widget basis). Themes will have a folder that also needs to be included in your project folder (along with the Lua module), which will contain the graphical assets that are required for that particular theme.

At the moment, there is only an iOS theme. We are working on an Android theme. You can take the iOS theme and modify it to create your own custom themes to share with others, or to simply have unique-looking widgets for your game or app.

 

Text

Previously, the widget library modified the display.newText() function, which caused problems with the new multi-line text capabilities.

Now, the widget library no longer touches the display.newText(), and as of build 2011.645, there is now display.newRetinaText() and display.newEmbossedText() to take care of your retina-display and embossed text needs.

 

Removed Widgets

The segmented control has been removed from the widget library, but has been made open-source for anyone who still wants it:
http://developer.anscamobile.com/code/segmented-control-widget

The tabBar is more cross-platform friendly and serves almost the same purpose as the segmented control, still, the source is available for those who absolutely need/want it.

The toolbar has also been removed, because you can now create an empty tabBar (or just use an image) and place embossed text over it using the display.newEmbossedText() function.

 

BETA Reminder

Unfortunately, if you were currently using the widget library in your projects and you update to this new version that will come out with build 2011.246, your code will break. This library is still in beta and is subject to changes, but we feel like these changes were necessary to keep moving this library forward, and closer to a more stable condition. Most-likely there will not be anymore changes to this widget library as major as this one, since I believe this update addresses most of the major issues that were present in previous versions.

Please take a moment to look over the documentation, and prepare to migrate your previous widget code to be compatible with this new version—you'll be glad you did :-)

http://developer.anscamobile.com/content/widget

The WidgetDemo in Daily Build 2011.646 has also been completely revamped to take advantage of all these changes, and to further demonstrate basic widget usage.

All year I have been playing with the Corona SDK. I took a bit of a break over the summer because I got busy with my full time Flex / Flash Consulting. I started back working on a game about a month ago.

Anyway ... I am really excited to have a subscription to coronasdk now so I can use all the great daily builds that are coming out. It's apparent that the team is really working hard to roll out features that make the sdk more usable and I am sure we will continue to see a lot of great stuff come our way.

Bubble Ball - number one free app by 14 year old developer Robert Nay

As of right now Bubble Ball is the number #1 app in the app store. "Big Deal" right? Well what makes this awesome is a couple of things. First and formost the app was developed by a 14 year old developer, Robert Nay. Number 2 the game play is awesome. Number 3 the developer used CoronaSDK to develop the app. Download it now and give it a try.

So, what does Bubble Ball have going for it? One word: Gameplay!

In Bubble Ball, you’re tasked with a simple mission: Get the ball from point A to point B. Each of the game’s 21 levels gives you a different route to navigate with different game pieces to assist in your deceptively simple-worded quest. Place the geometric pieces however which way you please to create ramps, platforms, and even catapults to send your ball to the finish line. At first, it’s easy; but in the later levels, it can be quite the stumper — but, you will not put your phone down until you figure the very last one out!

SWFSheet – create sprite sheets from SWFs | BIT-101

I have been using CoronaSDK for a while now. I am always on the lookout for tools that will make development faster. Keith Peters just developed and put out a tool that I know without a doubt that I will use. Enter SWFSheet, an AIR application that takes swf files and creates sprite sheets for you from the time line animations that you created in Flash. This is totally awesome. Now I can use my animation skills in Flash to create great png based sprites without too much effort at all.

Ghosts vs. Monsters: Angry Bird like game made with Corona in 36hrs

There’s a question that’s been asked many times over in our forums, e-mails, and at gatherings: Can Corona SDK create a game similar to Angry Birds, and how easy is it to do? Without a doubt, our answer has always been a solid “yes!”

Then, the next question has been “Can I see a demo?”

Native iphone and android components for flash developers

If you have been looking for native looking components for android and iphone development in Flash, well here you go.

as3iphonecomponents and android-components

I found the links from the following article about Native development vs. AIR. Some good points made in the article to help you as a developer choose what option will be best for your projects.

People want a uniform user experience

AS3 iPhone ComponentsAnd by “people” I mean “non-technical users.” And by “uniform” I mean “native.” People want all their interface components to have the same look and feel. Its gives apps a more intuitive nature. While Adobe’s Flex Hero interface components are uniform to Adobe Air apps, they don’t represent the components found on each individual mobile device.

You can, however, use AS3 libraries like as3iphonecomponents or android-components to preserve that native experience.

Particle Candy for Corona SDK by Xpressive Games

Well I figured it was only a matter of time before some developers started building and releasing some pretty awesome tools for the Corona SDK. Enter "Particle Candy". I personally have not used it yet but I plan too. Something like this should be perfect for the exploding astroids in the game I am building

See more at x-pressive.com

Progress on "flying space rocks" using CoronaSDK

Just wanted to post my progress on the mobile development I have been doing with CoronaSDK. I started out building this game in Flixel in the Flash Player. Development was pretty easy and I got most everything ported over but there are of course some differences when it comes to working with the physics in Corona. (thanks Matthew Pringle for the help )

 

The problem I was running into was how to get the Rocks to fly around randomly and also detect when they move off screen in order to place them on the other side of the screen just like in the classic game. The forums on the ansca site proved to be very helpful after some tweaking on my end.

I am not sure if I am detecting the objects going off screen in a very good manner as there is more than likely a more optimized way of doing it. I am basically using an enterFrame event to check all the x and y locations and then preforming some checks to place the object where it needs to be if it goes off screen. Below is the code for applying the phisics and also my enter frame function that I am using.

 

 

Get to it - Developing for iOS using Flash

I have still not jumped and created an app for Android yet. After the big Apple vs. Flash thing I kept my iphone. Mainly because I didn't want to drop $300 for another phone at the time. Like all the other Flash developers I was excited that I was going to be able to develop apps using flash. I am in the middle of building a game that I plan on putting on the app store and android market.

For you guys that have not given it a try or are just getting started here are some great resources for ios development with Flash

Check out this series of articles to help you learn more about developing for iOS using Flash Professional:

Here's a recap of related resources to check out on Adobe Labs: