LiveCode 7.0

by Ben Beaumount on February 24, 2015 No comments


Increase your app downloads and revenue by including the ability to localize your app into any language. Work with Arabic, Chinese or Japanese in your app just as easily as English. LiveCode 7 has also been reworked to create apps that are even better native citizens. Its buzz phrase heaven: Cocoa, GTK, 64-bit, the list goes on. It means your apps look and perform better on all platforms.

Unicode

The beautiful thing about Unicode in LiveCode 7 is that you won’t notice it. We’ve spent 18 months pulling the engine apart and rewriting it, putting in 5 man years and changing 2000 files so that you simply won’t notice a thing. You can just use it. Anywhere. Fields, objects, buttons, user input, file paths… it all just works. Right to left text, Chinese, Russian, Spanish, French or hieroglyphics. LiveCode won’t bat an eyelid.

Unicode Demo

Download the Sample Stack

Analyze

Not only can you use Unicode text, you can analyse it in ways that are unique to LiveCode. LiveCode probably has the best text handling of any programming language, anywhere (don’t believe me? Try it out for a while and see…) and now this extends to text that does not conform to the “European” structure. LiveCode can identify words within a Japanese text, which is not broken up by spaces, so the syntax

put trueWord 3 to 5 of line 6 of field “Japanese”

will now correctly identify and return the third word on the 6th line of your text, whether it is in English, Spanish, Japanese, Chinese or even right to left Arabic text.

Normalize

LiveCode now has a very handy “normalizeText” function. Why do you need this? Well, in Unicode, two identical looking characters may not in fact be programmatically identical. They can be composed in different ways, leading to unexpected results when you are running code. You can use the normalizeText to ensure that the character you are dealing with is always the same character.

set the formSensitive to true
put "e" & numToCodepoint("0x301") into tExample -- Acute accent
put tExample is "é" -- Returns false
put normalizeText(tExample, "NFC") is "é" -- Returns true

UnicodeEncode/Decode

Working with Unicode in LiveCode is all very well, but what about interacting with the outside world? When you send text outside LiveCode, or you import it, you can convert between text and binary, using encode/decode, to ensure compatibility in every environment. Supported encodings are:

“ASCII”

“ISO-8859-1” (Linux only)

“MacRoman” (OSX only)

“Native” (ISO-8859-1 on Linux, MacRoman on OSX, CP1252 Windows)

“UTF-16”

“UTF-16BE”

“UTF-16LE”

“UTF-32”

“UTF-32BE”

“UTF-32LE”

“UTF-8”

“CP1252” (Windows only)

For more detail and information about LiveCode 7 and Unicode, please see our full release notes, available here. You can read blog posts about our Unicode journey here.

Increase Your Revenue

Find out how the new UniCode Feature can help increase App Downloads and Revenue with App Localization in LiveCode 7.

Resolution Independence

Any screen size, any resolution, anywhere.

deskhighdpi

LiveCode now has full Resolution Independence. Your app will scale to fit any screen or device, whether it is a full size Mac Retina or a tiny Android phone. You don’t need to do anything fancy to make this work, no more switching between sets of assets for different deployment options. LiveCode fully supports high density screens by upscaling text, vectors and automatically substituting in high quality images. To ensure your image and graphic displays are always pixel perfect we’ve added some clever coding in 7 – see the sections on 9 way stretch and icon gravity under “Crisp Cross Platform Graphics”.

FullScreenMode

Download the Sample Stack

This feature allows you to scale your app to fill the screen in a variety of ways. Its pretty simple to apply. In the stack script add the following code:

on preOpenStack

set the fullscreenmode of me to “exactFit”

end preOpenStack

fullscreenmodes

Density Mapped Images

Download the Sample Stack

If you don’t want the overhead of scaling, you can include a range of images from very small low density to very large high density images and LiveCode will automatically switch between them, depending on the screen they are being displayed on. This means you can effortlessly support a tiny, low powered Android device as well as a big full Retina Mac screen.

Density-Mapped

Multiple density image support for patterns

This extends the existing image resolution independence features to any pattern using that image. When an object pattern is set to a multiple density image, that pattern will automatically use the best source image for the density at which it is drawn.

What does Resolution Independence mean for you?

We know all about the pain of catering for all the different shapes, sizes and resolutions of your customers or potential customers devices. Let’s face it, it has been a headache for designers and developers for years. With new devices coming to the market on what feels like a daily basis, can you really afford to spend the time and effort redeveloping your application to suit them? Can you afford not to? LiveCode 7 allows you to add just one of line of code to your application and you can rest easy knowing that your app will display perfectly on any screen size, any resolution, anywhere. Your welcome.

Crisp Cross Platform Graphics

We’ve done some fundamental work on the way LiveCode 7 displays graphics. This is aimed at speeding up displays and ensuring your graphics display correctly on all screens sizes and densities. This means you have a better, simpler, coding experience, and your end users get an improved app experience, where the screen updates faster and is consistent across all platforms including Mobile.

New Graphics Library

Bringing your app a beautiful UI. Between last February and now we have written an entirely new Graphics Library, so that you can run your apps on all screen densities and devices without loss of image quality. The first iteration of this became available in LiveCode 6.5 and since then we have been building on that and refining it continually. LiveCode 7 brings you some specific new items.

Screen Regions

During our refactor of LiveCode, we introduced support for high density (Retina) screens. Since then, to ensure fast performance we have changed the way graphics are displayed, so that LiveCode only redraws the region of the screen that has actually changed. We have updated some of the older code in the engine, replacing lots of platform-specific region code with a single region object that could be used on all platforms. The end result is faster screen redraws, ensuring your app is responsive on the biggest screens as well as the smallest.

Nine Way Stretch

Download the Sample Stack

LiveCode now supports the ‘nine-way-stretch’ method of scaling images. What this means is that you can now create a single image for use as a background of an object such as a button, where previously you might have needed as many as 9 separated images. You set the ‘centerRect’ property of the image to the rectangle of the image which you want to stretch. With this done, the areas outside of the centerRect either do not scale, or only scale horizontally and vertically.

For example, if the centerRect of an image which is 16×16 is set to 4,4,12,12 then:

  • The 4×4 corner portions of the image will not be stretched
  • The top 4×8 and 8×4 side portions of the image will be stretched horizontally or vertically (depending on orientation)
  • The middle 8×8 area will stretch to fill the middle.

Icon Gravity

This is a big deal, especially if you are designing User Interfaces. You can now scale a graphic or icon separately from the object it is contained in, and place it precisely within that object. So instead of needing multiple instances of your graphic at different sizes, you can now have a single graphic and display it differently in different parts of your app – scaled for a button for example, and placed at the bottom or top of the button.

The Effective Points

You can now use ‘the effective points’ and ‘the effective relativePoints’ properties of a graphic object to fetch a polygon representation of rectangle, round rectangle, oval and regular polygon graphic objects.

Server Graphics

You can now use graphics with the LiveCode Server engine. You can try a hands on tutorial for this here. This enables you to work with and edit graphics and icons uploaded by your users – for example we will be using this to display icons for user contributed widgets in upcoming releases of LiveCode.

Embedded Web

The new implementation of the CEF Browser Object means that developers can create hybrid apps that incorporate web content easily with consistent content on Mac and Windows. Any app can have an embedded browser displaying content on Mac, Windows, iOS and Android.

Download the Sample Stack

There are a hundred reasons you might want to use this feature. You might want to embed a browser to display a google map for example, or give your users access to a file repository such as iStockphoto. You can use it to display documents such as pdfs. For vertical markets, a tightly controlled browser experience with a custom embedded browser can be the way forward – for administering exams to students for example.

Javascript Integration

The new chrome browser allows you to call LiveCode handlers from within the browser using JavaScript, bringing a whole new meaning to “integrated app”.

To make a LiveCode handler visible to JavaScript, use the revBrowserAddJavaScriptHandler command, and to remove it use the revBrowserRemoveJavaScriptHandler command. LiveCode handlers are added as functions with the same name attached to a global ‘liveCode’ object. When called, these functions will result in the corresponding LiveCode handler message being sent to the browser card with the browser instance ID and any function arguments as parameters.

Example:

With the handler “myJSHandler” registered using revBrowserAddJavaScriptHandler, it can be called from the browser like so:

liveCode.myJSHandler(tFieldContents, tAction);

the LiveCode handler would then be called with the following parameters:

pBrowserInstance (the browser instance id, as returned from the revOpenBrowserCef function)
pFieldContents (the first argument of the JavaScript function call)
pAction (the second argument of the JavaScript function call)

To learn how to embed a browser in your app, check out this tutorial.

How does this benefit your app?

We have talked about the reasons you might want to use this feature, but what are the benefits of having a browser embedded within your app? From a customer experience point of view, your users no longer have to leave your app to view the information you are displaying to them through the browser. You are essentially providing a complete experience for your user instead of sending them away to their native browser and hoping that they come back to your application.

Cocoa Native

Our number 5 top feature for LiveCode 7 is the Cocoa port for Mac OS X. LiveCode is now a native player on Mac OS. What does this mean for you? 

Embedded Native Objects

Cocoa support means that you can now embed native objects in LiveCode windows, instead of floating them above. This means integration is smoother, better, simpler and complex implementations such as revBrowser run a million times better. Putting it another way, your app will have the look and feel that Apple users expect with no sacrifice of features.

Appstore Submission for Mac OS App Store

Ditching Carbon also means that LiveCode is now an accepted citizen in the Mac App Store sandbox. If you want to use the App Store instead of or as well as your own website for your apps, you can do this without issues.

New Player

To round out our native OS support on Mac, we’ve provided you with a brand new player object with a custom video playback controller. This player hooks into Apple’s AVFoundation. This means you are bang up to date with Apple’s latest multimedia support, and can take advantage of its shiny new features. Your apps can sing and dance beautifully.

Yosemite

We’re still working on full Yosemite support which will become available within the next 1 to 2 weeks. A few changes were introduced by Apple at the last minute, we will incorporate them in a .01 release for seamless support.

Read more about the Cocoa port in our release notes, here.

Raspberry Pi

For the first time we have a Community supported new LiveCode platform. Our Raspberry Pi build has its own dedicated band of community users who work with it and on it, and offer support and debate via the Raspberry Pi forum. If you love Rpi, get involved!

Raspberry-Pi

What is it for?

The Raspberry Pi is great for education, use in computer science, fun for students, hobbyists old and young, and handy for home automation. LiveCode is great for all these things too… what a happy coincidence! Let’s get together…

How it happened

We’ve been casting eyes at Rpi for some time, with the very first extremely rough build created shortly after the open source initiative in February 2013. It languished for a while, until Fraser Gordon joined our team. Fraser, it turned out, was a secret Raspberry Pi aficionado, and decided to work on the build in his spare time. Some months, several builds, and a community forum later, the Community edition of LiveCode Rpi was born.

What you can do

The RaspberryPi standalone engine is now available in the Community Edition IDE on all platforms – just look for “Linux ARMv6HF” in the standalone settings. LiveCode on RaspberryPi can build standalones for Linux (32-bit or 64-bit x86 and, of course, RaspberryPi), Windows and OSX.

Where next?

LiveCode for Raspberry Pi is just at the beginning. A community is forming around it, and many goals are taking shape. We need to better integrate LiveCode with the package management systems in common use.

The RaspberryPi provides a number of features not found on “normal” Linux installations – GPIO pins, a digital camera interface and lots of hardware boards extending these features. LiveCode currently does not have an easy way to interface with this – for some features, access can be gained through special files in the `/proc` filesystem bit this is round-about and ugly. Ideally, this functionality should look like any other LiveCode syntax.

One thing that the existing desktop IDEs can do that can’t currently be done on the RaspberryPi is deployment to an Android standalone. This is because there is no ADK (Android Development Kit) available that will run on the Pi. While the Pi is slower than many (or perhaps most!) Android devices available today, it would be fantastic if we could get one running as it would allow direct deployment of Android apps from LiveCode on the RaspberryPi.

We’d love to see LiveCode come preinstalled on Rpi’s alongside Python and Scratch.

Download LiveCode Rpi here.

Native 64 Bit Linux

For the 7 release, LiveCode’s Linux support has received an overhaul. We’re particularly pleased that as part of this we now have a 64bit Linux/Server engine, making LiveCode Server a powerful playground for cloud oriented geeks everywhere.

64bit

Native Theme Support

We have moved from the outdated Xlib to GDK/GTK. What does this mean? Essentially, LiveCode on Linux is now more native, draws windows and graphics better, works on a wider range of Linux distributions, and is generally smoother, faster and nicer to use. It also supports LiveCode’s new Unicode functionalities. This update has resolved a long list of outstanding issues with LiveCode on Linux. If you have been using older versions of LiveCode on Linux, we think you’ll love this update. If you’ve never tried it… come on in, the water’s lovely.

64 Bit Linux and Server

In conjunction with the LiveCode Community, a 64bit Server/Linux engine has now been created. This is a big deal for anyone working with server technology. Linux is the default operating system for most hosting/cloud or server environments, and most of these are now 64bit. No more hunting around for compatible 32 bit libraries, just download and install the LiveCode Server engine, and you’re up and running. Find out what you can do with LiveCode Server here. As a huge bonus of implementing 64bit, you will see an astonishing power and speed boost – we tested by bouncing animated balls on a screen. Where before we could bounce up to around 150 balls simultaneously, it was now perfectly smooth with 400 bouncing balls.

The Future

The work we have done porting Linux to 64 bit means that the port for other platforms is not now far behind. We are already looking at the Mac port for 64 bit, and Windows will follow. Adding GDK support means we are close to deploying a new media player for Linux, as well as browser support based on the CEF browser implementation already running on Mac and Windows.

Specific Linux Bug Fixes

If you’ve ever been affected by any of these, you’ll be delighted to know they are now fixed!

http://quality.runrev.com/show_bug.cgi?id=5945

http://quality.runrev.com/show_bug.cgi?id=8055

http://quality.runrev.com/show_bug.cgi?id=8637

http://quality.runrev.com/show_bug.cgi?id=9058

http://quality.runrev.com/show_bug.cgi?id=9405

http://quality.runrev.com/show_bug.cgi?id=13025

http://quality.runrev.com/show_bug.cgi?id=12609

http://quality.runrev.com/show_bug.cgi?id=12607

http://quality.runrev.com/show_bug.cgi?id=11828

http://quality.runrev.com/show_bug.cgi?id=11206

http://quality.runrev.com/show_bug.cgi?id=10676

http://quality.runrev.com/show_bug.cgi?id=12233

Download Linux 64 Bit Server here

Ben BeaumountLiveCode 7.0

Join the conversation

*