10 January 2014
From the Forum — Issue #2
Welcome to the second installment of From the Forum. In this series, guest blogger Alex Jackson will highlight outstanding threads from the Corona Forum. The goal is to bring attention to the most captivating, interesting, and thought-provoking discussions taking place in our very own backyard.
Please visit the forum to join these conversations or start your own!
1. On love and game loops
I think we can all agree that Corona is a useful tool for developing several different kinds of applications. E-books, business apps, hand-held references; I’m not going to bore everyone with a marketing pitch. However, there has been a steady influx of new users looking to make the next indie game masterpiece!
The most important tip that comes from the forums is to implement (and perfect) your game loop. If you aren’t familiar with the concept of game loops, here’s a very simple reference:
The quick and dirty of it is, you want a continual check to identify game states, win/loss conditions, score allocations, and so forth. Having a well-conceived loop will make your game run much more smoothly. The real question here is: Runtime, timer, or some hybrid of both? It’s a crucial decision and it shouldn’t be made lightly.
I put together a few links from the forums discussing the best way to implement a game loop. Truck over and put in your opinion, or grab some new ideas!
2. Not just fun and games
You may have noticed by now that I’ve been focusing a lot on game development. Mostly, that’s because a lot of the chatter in the forums has been leaning this way. But I don’t want this section to be all about recreation. Corona can do a lot of stuff very, very well. A very popular API is the scrollView(), nestled within the widget library.
With such a powerful tool, you may run into some problems. One is the implementation of native text fields inside of scroll views. A few intrepid developers have been slogging away at creating a generic text field which allows for entering text into a scrollView. Lo and behold, user “Summit Tech” has emerged victorious! Click over to the original thread to see Summit’s code snippet and see if you can’t pick up a few more tips.
3. Work and play, all in one tight package!
Continuing on our theme, we’ve all seen that text fields play a large role in business apps. Calendars, GTD reminder apps, recipe lists, and reference doc apps are all very useful entries in the mobile app ecosystem. But, if your users can’t enter or search for information correctly with a unified UI that scales for devices, you’re going to be left out in the cold!
Enter Atanas and Ksan (Kerem), two developers trying to put this issue to rest once and for all. They have started producing a new widget option they call “newEditField()“, which should address device scaling, common text inputs, usage within scrollView() and tableView()— and it also ties your shoes in the morning (one of these claims may be false!). Here are just a few of the features they have implemented:
- manages and moves edit fields automatically with groups
- supports 9-slices , 3-slices and round-rect frames
- supports labels for edit fields
The widget isn’t yet ready for prime time, and Atanas can use as many beta testers as he can get. Head over to the original thread and lend a hand — you never know when you’ll need a robust widget option like this for the next Epicurious app!
Alex Jackson is an indie developer and the founder of Panc Software, specializing in retro-style gaming. He has created several mobile applications, enjoys long walks on the beach, pixel art, and reading the Corona forums. Contact him by email or follow him on Twitter: @pancsoftware.