Daily Build Roundup: Win Simulator + Android + Transition 2.0 + iOS

Daily Build Roundup: Win Simulator + Android + Transition 2.0 + iOS

We’ve been pushing a lot of changes into daily builds since the last public release. If you’re a subscriber, you’ll have immediate access to a boatload of cool new features across iOS, Android, and our frameworks. Here are the highlights:

Corona-Simulator-Windows-Preferences

Windows Simulator

Windows users can now enjoy the same workflow that Mac users have long enjoyed.

The first is a killer feature. Whenever you make changes to a file in your project, the Corona simulator can automatically relaunch your project. This lets you make edits to your file and see the Simulator change live and in real-time! You can control this via the ‘preferences’ to always relaunch, prompt, or never do it. Personally, it’s something I use all the time.

The other improvement is the ability to have the simulator open the last active project when you launch the Corona Simulator. It’s turned off by default, so if you want to use it, there’s a setting (“Automatically open last project”) to turn it on in the preferences.

Android

We’ve been making a ton of Android improvements, including a smattering of items like:

  • native.newVideo() which (finally) adds support for native video objects on Android.
  • Application icon support for xxhdpi devices.
  • system.getInfo(“androidDisplayDensityName”) which returns “xxhdpi” for those devices.
  • Improved suspend/resume stability for apps using “location”, “heading”, “accelerometer”, or “gyroscope” events.

We’ve also make some significant infrastructure improvements to image and texture loading:

  • display.newText() now can create text much faster and use less memory.
  • Text objects can change their text much faster.
  • JPEG files now load 2-3 times faster and use less memory.

These improvements are a big deal if you need to load lots of big images. Thanks to these changes, you’re less likely to hit out-of-memory errors in the Dalvik (Java) VM.

[Update] Another benefit reported on the forums: Tableview performance is significantly improved on Android devices!

Transition 2.0

We’ve started a long-overdue upgrade to our transition library:

  • Pause/resume transitions by object, by tag, by reference — or all of them. See transition.pause and transition.resume.
  • More options for transitions such as the ability to tag them or set them to repeat. See transition.to for a complete list.
  • The complete set of Robert Penner easing functions.
  • A bunch of convenient functions for fading in/out, blinking, moving, and scaling. See transition.

We’ve got more improvements planned, so in the mean time, take it for a spin, read up on the updated transition library guide, and let us know what you think!

iOS

Starting in Daily Build 1214, we’ve officially switched over to using iOS 7 as the “Base SDK.” By defaulting to iOS 7 as the Base SDK, your app will now be treated as an iOS 7 app. That means when you use native widgets like textfields, you’ll get the iOS 7 look on an iOS 7 device.

Previously, we defaulted to iOS 6 as the Base SDK which meant that when you loaded the app on an iOS 7 device, the app would be treated as an iOS 6 app, down to the look and feel of UI controls like the keyboard.

Now, we’ve also tried to make sure your app still runs properly on an iOS 6 device. If you use the widget library, the one thing you’ll have to do is to make sure you select the correct theme. You can dynamically choose between the iOS 6 theme and the iOS 7 theme:

The more I think about it, the more it makes sense for the widget library to automatically select the iOS 7 theme when running on an iOS 7 device. Chime in on the comments if you agree.

One thing we had to do before changing the Base SDK was address various issues due to changes in iOS 7. For example, the status bar APIs in iOS changed so we had to make sure we could still change the status bar in both iOS 6 and iOS 7, using the correct API for each version of the iOS. We also worked around several random iOS 7-specific issues like textfields losing the last character (same code worked fine on iOS 6).

There is at least one known issue that appear to be an iOS 7 bug related to Game Center. The issue is that the achievement notification only shows for the first achievement. Specifically, this is the one that gets delivered to iOS’s Notification Center; you’re still free to present your own notification. We’ve seen other reports on the Apple dev forums on this issue as well.

Finally, if you want to skip the PNG crush step during device builds, you can add a “skipPNGCrush” flag to your build.settings file:

walter
14 Comments
  • Daniel Williams
    Posted at 11:29h, 26 September

    Great stuff!

  • develephant
    Posted at 11:49h, 26 September

    Awesome! Thank you.

  • Alex
    Posted at 13:34h, 26 September

    Few questions about the new transition library:
    – can you set a parameter to “reverse at the end” the object when it comes back (meaning it will play backwards)?
    – is it possible to tell the library to change xScale to -1 at the end of the path (for example, the object will change “direction” when it comes back to the starting point)?

    Thanks,
    Alex

    • Brent Sorrentino
      Posted at 16:23h, 30 September

      Hi Alex,
      On your two points:

      1) I think the method you’re looking for may be the “continuousLoop” easing function. This reverses the object back to its initial state. However, the interpolation will be linear, so if you need to reverse a tween on another easing method, i.e. “inCirc” then back on “outCirc”, you’ll need to queue up two transitions for that. All of these are detailed in the new easing document: http://docs.coronalabs.com/daily/api/library/easing/index.html

      2) I think you could do this with an onComplete listener, yes? Maybe I’m not following your exact use-case, however… please let me know if not.

      Hope this helps,
      Brent

  • Josep Alemany
    Posted at 14:53h, 26 September

    I can t wait to test some of the new features… Good Job!!

  • Dave
    Posted at 15:58h, 26 September

    YES!!!! No more ctrl+R to reload the simulator 🙂

  • Lerg
    Posted at 18:12h, 28 September

    Great stuff!

    I would like to suggest a useful addition to transitions 2.0 – ability to make back and forth easings.
    You only have continiousLoop easing, but I suggest that you either add backAndForth param in transition.to function call (like in my timers and transitions library), make additional easings like easing.outExpoBackAndForth (outExpo2) or supply a wrapper around easing functions like this:

    http://pastebin.com/Ky9ystY2

    Save it as main.lua and see – it’s really fun. A bouncing square with one transition call.

    • Rob Miracle
      Posted at 15:54h, 30 September

      Hi Lerg. I think this is the idea behind sequences is that you can setup a forward transition than then switches to a reverse transition that would loop back and forth.

      • Lerg
        Posted at 18:16h, 30 September

        But don’t you agree this is so much easier with that wrapper function?
        Only one line of code without any sequences.

        transition.to(square, {time = 1000, y = 30, transition = backAndForthGenerator(easing.outExpo), iterations = 10})

  • Jacques
    Posted at 00:37h, 30 September

    After you guys put in transitions2.0 i keep getting errors after certain simple transitions complete that previously had no issues at all (was using .1202 previously, just recently installed 1217. Annoyingly enough, I had to keep installing older versions until i got back to build .1206 before the errors stopped happening, so obviously it has to do with the transition2.0 addition. Seems like some timing/variable issues with your new transitions for sure because the error doesn’t make sense since the traceback points to an empty lua line that doesn’t even have any code on it! Moreover, what field it is referring to is even more weird since there’s no field relevant to the error.

    Runtime error?:0: attempt to index field ‘?’ (a nil value)
    stack traceback:

    Please advise, because you guys do have some interesting things going on with transition2.0 but at least get it to work properly.

    • Rob Miracle
      Posted at 16:06h, 30 September

      Hi Jacques.

      We are aware of these errors and Engineering is working to address them. If you want to follow the discussion in the forums, here is one of the threads:

      http://forums.coronalabs.com/topic/39518-transitioneasing-20/

      • Jacques
        Posted at 03:41h, 01 October

        Okay great I was worried it was my code and have been rechecking everything over and over again. Thnks for the heads up 😉

  • Lerg
    Posted at 18:18h, 30 September

    Also it’s worth noting that easing functions value span has been changed to [0, 1]. Before easing functions were returning absolute values, now only relative.

    If you had any custom easings – you might have to adjust them.

  • Paolo
    Posted at 06:52h, 01 October

    Thanks for transitions 2.0. I am surely going to use the transition tagging system to keep track of my tween from now on (so much needed). Still some ” Runtime error?:0: attempt to index field ‘?’ (a nil value) “, though as noted above. Hopefully it won’t take long… good job