As the “freemium” app monetization strategy has grown in popularity, many developers have encountered the same problem: how can we give away fully-unlocked copies of our app to reviewers or friends? Apple gives developers 100 free promo codes for each new version of an app to hand out, but Google Play does not, and even so those codes only help if your app doesn’t unlock features via in-app purchase (“IAP”). As of now there is no way for us to hand out IAP promo codes (though there are reports that this may change). To make matters worse, if you try to create your own system for unlocking features, the odds are very good that your app submission will be rejected by Apple’s reviewers. To the best of my knowledge, there’s nothing stopping you from creating your own IAP promo code system on Android, but who has time to create a whole menu system for unlocking content? Fortunately there is an easy way to unlock content on both iOS and Android simultaneously, with very little change to your code – and since this method is completely invisible, it does not trigger an App Store rejection! Read on to find out how… READ MORE »
Posts in category Corona SDK Resources
Add a Color Picker To Your Corona App With One Line of Code!
Last week I posted a tutorial showing how to enable finger painting in your Corona apps, and while I was putting together a sample app for that post I decided I wanted to enable users to change the color of their virtual paint from right within the app. So I did some searching on the web for a “color picker” I could plug into my sample app, and I did find a number of options (here’s one example), but none of them gave me exactly what I was looking for.
The closest fit for my needs was a terrific bit of code that somebody with the user name “StarCrunch” contributed to the Code Exchange last year. StarCrunch’s code was pretty darn close to what I envisioned – and most importantly, he or she had already worked out the math used to power a visual color picker, something I had no interest in doing from scratch. However, there were a few issues I needed to fix in order to fully meet my needs:
- I needed Graphics 2.0-compatible code (this is especially important for anything dealing with color, since RGB values are no longer on a 0-255 scale)
- I needed the picker to “return” the RGBA values for a picked color so that something could be done with them.
- StarCrunch’s code calculated the hex code for a picked color and displayed it on-screen. This is useful information, but just not something I needed.
- I needed a way for the user to adjust the alpha value of the picked color using their finger.
- I wanted to remove or hide the picker after the user had picked their color.
- I wanted my picker set up as an external module that could simply be included into any existing project (for easy “one line of code” integration).
So I set to work creating my own color picker, with StarCrunch’s excellent code to lead the way. The result is colorPicker.lua, my own color picker module that can be added to any Corona project with just one line of code! READ MORE »
Finger Painting in Corona With Just One Line of Code!
UPDATE (2/17/2015): The fingerPaint module has been updated to version 1.5, with new features and updated syntax for the fingerPaint.newCanvas() function (though it is backwards-compatible with the older v1.0 syntax). The links on this page will download the updated version.
Click here for details on version 1.5.
In 2012 I programmed a fun little iPad app called Gordon & Li Li: Learn Animals in Mandarin, for which I needed the user to “draw” on the iPad with his or her finger. At the time, there was no clear established method for accomplishing this in Corona SDK (I’m still not sure there is one), and the closest bit of code I could find on the Corona forums didn’t really get the job done to my satisfaction. So I came up with my own solution that worked really well for my needs and shared it with the community on Corona’s Code Exchange. (You can view that original post here.)
Now that I’m posting Corona tutorials here, I thought I’d revisit that code, which at the time existed only as a simple main.lua file and convert it into a Lua module so that it could easily be plugged into any existing Corona project with just a single line of code. I also took it as an opportunity to clean up my code and make sure that it is fully compatible with Corona’s newer Graphics 2.0 APIs. If you need finger painting in your own app, feel free to download the module and plug it in. Or if you want to dig deeper and modify the code to suit your own needs, please do, and share your edits in the comments! I’m making it available under the standard MIT license, so do with it whatever you like.
Let’s Finger Paint!
I’ll dig into the module’s code further down in this post, but for those of you who just want to type in that “one line of code” I promised and get finger painting, here’s how: READ MORE »
Game Controllers in the Corona Simulator
This is a reposting of a blog entry I contributed to the official Corona Labs blog back in November 2013. You can view the original post here.
I finally got around to purchasing an OUYA last week, thrilled by the possibility of creating the sort of controller-driven games I enjoyed back in the halcyon days of the NES and Sega Master System. I’ve only had a few hours of hands-on time with the OUYA, but so far I’m impressed. The hardware seems solid, the interface runs smoothly, and of course, since Corona has built-in support for OUYA and its controller using the “key events” API, I’m well-positioned to create the next OUYA runaway hit!
Test Environment
I do all of my development work on a Mac, and the Corona Simulator does not currently support controller input like it does on Windows (OS X is generally not very “joystick-friendly”). So, to properly test changes to my OUYA-targeted games, I’d typically need to create a build, transfer the APK to the OUYA, move from my computer to my TV, and pray that there isn’t some silly little bug in my code that requires me to start the entire process over. One of my favorite things about Corona is that I can see changes in my code reflected instantly in the simulator — but it seems this isn’t possible if I want to use a controller. What to do? READ MORE »
Web-Based Alternative to native.newMapView()
This is a reposting of a code snippet I contributed to the Corona Labs Code Exchange back in 2012. It’s worth noting that the impetus for this bit of code was that in 2012 Android native map views were not yet available. Corona’s APIs have evolved quite a bit since then and Android native map views are now on-par with iOS. However, there are still some developers who prefer the level of customization you get by displaying your map in a webView generated with the Google Maps API.
Furthermore, fellow Corona Developers T and G Apps Ltd. have taken this code and expanded upon it, offering an even greater level of customization. You can check out their expanded version here.
Hi Everybody,
I don’t know about you, but I’ve grown desperate waiting for Android MapViews, so I’ve taken matters into my own hands and come up with what I think is a pretty decent workaround, using HTML, JavaScript, and a WebPopup. READ MORE »