It’s Wednesday and time for another FAQ session. Here are five frequently asked questions (FAQ). Question 1 Why is text spacing/positioning slightly different between the simulator and device? Answer The fonts are not the same between devices and simulator. The native.systemFont is different depending on the OS. On the Mac, it is LucidaGrande 24 pt. On iOS, it’s Helvetica. On Win, it’s something else. Different fonts have different font metrics even at the same point size, so that will mean differences in alignment. Even for the same font, there can inevitably be differences, since the font rendering is done by the OS. While MacOS and iOS share similar code paths, the underlying text drawing is slightly different. The same fonts will have slight differences glyph
Posts Categorized: Lua
It’s Wednesday and time for another FAQ session. Here are five frequently asked questions (FAQ). Question 1 How do I bring the Corona window back to the desktop? Answer This is a common issue with Windows programs where the window will disappear if it’s on an external display and the program is restarted without the display. The program is not hung, just trying to display the window on a non-existent display. This can occur with the Corona Windows Simulator (this is not an issue with the Mac Simulator) and here are the steps for getting back the window: Right click on the Corona Simulator tab in the task bar Click on “move” Press an arrow key (left, right, up or down) Move the move until
It’s Wednesday and time for another FAQ session. Here are five frequently asked questions (FAQ). Question 1 Now that you added the Lua File System (LFS), how can I use it to get a list of files in the /Documents directory? Answer The Lua File System was added starting with Corona build 2012.805. You can read the tutorial here. The LFS now makes it possible to create, delete, and access subdirectories. The key to all of this is creating a string containing the path to the directory. In iOS and Android, there are three main directories: Resource, Temporary, and Documents and they are accessed using Corona constants. These userdata constants need to be converted to a string so they can be used with the LFS.
It’s Wednesday and time for another FAQ session. Here are five frequently asked questions (FAQ). Question 1 When I create functions, I sometimes get error messages saying the function name was nil. I play with the code until the error goes away. What are the rules for getting it right?
It’s Wednesday and time for another five frequently asked questions (FAQ). Question 1 Why do images take longer to load on the new iPad (retina)? Answer This issue came up when a user was using large JPEG images on the new iPad Retina and noticed the time to load the images were a lot higher than on the iPad2. One of the reasons is the new iPad accepts larger image sizes, but we also found out a few things that might help if you have images that take a long time to load. First off, use non-progressive JPEGs. Progressive JPEG take longer to load. How you compress JPEGs makes a difference in load times. Compressing to 70% or 80% can cut down the time to
This is a new series of blog posts that will appear every Wednesday and covers five frequently asked questions (FAQ) from support cases, the forum, and documentation comments. Hopefully there will be something here for both the experienced Corona users and those using Corona for the first time. So let’s get started.
There has been a lot of material presented over the last four parts. In this final part, we will finally go into some detail about our automated testing system for Android. We will also finally get an opportunity to bring everything together by looking a little more how our shell scripts orchestrate the test run and connect components from the previous parts. Android was a lot easier to setup automated on-device tests than iOS because the entire toolchain is command line driven. But ironically, actually running the tests has been more unreliable for us, mostly due to some bug related to adb. For some reason we can’t explain, adb will hang on us and it will not allow us to communicate with our device. This has
We allow Corona developers to also build for the Xcode iOS Simulator. Sometimes the simulator is preferable to our Mac or Windows simulator because the Xcode Simulator behaves more like a real device. Since we officially support the Xcode Simulator, we run our automated tests on the Xcode iOS Simulator to help verify our stuff actually works. While we could theoretically reuse the same process of scripting Xcode that we described in Part 2, we opted for a slightly different approach. As described in Part 2, Xcode 4 broke everything so we didn’t want to put this in the same critical path. Furthermore, Xcode 4 has some very nice speed improvements and reduces our build times to almost half. So instead, we simply use the command
As stated in Part 1, we use lua-TestMore for our testing and reporting. The output format is called TAP (Test Anything Protocol) . It is human readable and simple. TestMore and TAP are widely used enough that there are tools available to help you use it.
Now that you’ve seen the overview of the whole system, I’m going to talk about on-device testing on iOS first because this has been where we have endured the most pain.