Sweet...More Candy...

Following our previous review on Particle Candy, we have more candy for you... Text Candy. This come from x-pressive.com and is one of the two libraries that are available for those developing using CoronaSDK for advance graphic effects.

For many of the younger readers or the new gamers, games have been all about Physics, let a ball fall and bounce around *automatically* that's a game. I must be honest, some have even found to have made that simple concept into a very interesting game. However, in the past, around the 80's when the 8-bit home computers were gaming consoles, the C=64, ZX Spectrum, Atari and the Amiga. These screens were mostly text based consoles with the functionality to switch to graphics mode or mix and match. Some of the coolest effects that developers came up with at the time were Double Height characters or stretched double width characters. Some used sprites/UDG (User Defined Graphics) to create that. If you have been from that era you can also almost recollect that Scandinavian Hackers Group, one of the groups that would crack the copy protection on the games and deliver those for the masses, but they would insert a sine scroller that would print out greetz to their friends. It was one of the best things to see, text scrolling as a sine wave.

Then there were the Scenes/Demos and the competitions, most entires were trying to push the limits of the hardware to the max and many would have a really interesting combination of text introducing their work. You can still find many of those demos/scene demos/intros and marvel at them. So when I saw the video for Text Candy when it was released, my first thought were...This can re-ignite the scene/intro/demos on mobile device, after all we are again at the point where developers are looking at pushing the devices to get maximum performance.

So what is Text Candy

Is it a type of Authoring software? I mentioned Demo, Scene, etc earlier. No Text Candy is a third party library written in Lua that allows for creating text effects. It can not only allow for True Type Fonts, but also for Bitmap Fonts.

Bitmap fonts...

Do we use those bitmaps any more? Haven't we moved on to the PNG and JPG formats, etc? Bitmap Fonts are so called as they are rendered fonts of a particular size. True Type/Open Fonts are on the other hand called Vector Fonts, which mean that the vector fonts can be scaled to a size large or small and retain the crispiness as it is defined as a series of lines that are scaled. The Bitmap fonts are images, which when scaled up would be prone to pixellation, but can provide excellent colours and effects to be applied.

Why do I need text effects?

Look around, we are faced with text literally in our faces, Print AD's place text at angles, in varying sizes to evoke emotion, etc. On the telly, Text glides from one corner to the other, Titles in a Movie, even to the extent in games when you level up, get an item, lose a life, etc.

Now, let us look at what Text Candy can do for us. Like Particle Candy, Text Candy is also distributed as Lua source file (One of the limitations for a 3rd party library developer using CoronaSDK). There is no byte code compiled add-ons or C++ type extensions that can not only protect the IP/Source but also provide faster and more efficient effects. Just like all of x-pressive.com's work despite the shortcomings that CoronaSDK might have to offer against the new functionalities being offered on mobile platforms, Text Candy is fast, and not just fast, blazingly fast.

How do I use it?

When you purchase Text Candy, you get all of the demos and the source, including a series of bitmap fonts. The core of all this is a file called lib_text_candy.lua which needs to be included in the applications using require("lib_text_candy")

The other steps involved would be to Add a characterSet, even if you were to use a Vector Font (TTF/OTF) or a Raster Font (Bitmap Font) the process of adding a character set is absolutely necessary for the library to use that font.

Then is is as simple as
local BGText = TextCandy.CreateText({
 fontName  = "SPACE",       
 x  = screenW*.5,      
 y  = screenH*2,      
 text   = "TEXT CANDY TEXT CANDY ", 
 originX   = "CENTER",       
 originY   = "CENTER",       
 textFlow  = "CENTER", 
 showOrigin  = false,

The library has effects all neatly tucked into their own folders. The Bitmap fonts are basically set up using Zwoptex and can be easily used as sprites in CoronaSDK. The features tour example is also included, however the only difference is that without the music, the example app lacks in that one dimension and the You-Tube video excels with music.

An example of scrolling text
    type  = TextCandy.DEFORM_CIRCLE,
    radius  = 140,
    radiusChange  = -1.7,
    angleStep = 10,
    autoStep  = false,
    stepChange = .15,
    ignoreSpaces = false

when the above code is called, it positions the text, but if we need it animated, it has to be called multiple times, and the best place for that is “enterFrame”

In fact there are examples that show how to split the text and creating a wrapping paragraph, overcoming the limitation of displaying multi-line text in CoronaSDK. The other problem with the code example was that the text could not be aligned or justified, With Text Candy it is now a breeze. To add to that further, each text FX created, it can be assigned a background. If the text is large, and needs scrolling, scrollbars can be automatically attached to the text paragraph.

One thing that I felt was a bit strange and weird was the fact that all text is mono-spaced. This is understandable for bit-mapped font but for the Vector Font, it could have been variable width. I may be highlighting this point as an observation, but when I look at the feature tour demo again, despite knowing that all font are fixed width, I can hardly notice that being an issue.

Given how well text is managed with Text Candy, I might almost recommend that it be used for more accurate text positioning and display, like in eBooks, etc. The only reason that it cannot be suggested is that since when the textBlock is created using Text Candy, each character is a separate newText item, so not very practical with large amounts of text.

It would be easier described that Text Candy is for Title FX and the kind.


Though it might seem like nothing great, just a couple of text effects, it is a very powerful friend that a developer can have. one that can add that extra polish to the app. The possibilities are just enormous, it is a bit of a surprise despite the rest being 0

There are much fewer things to do in the app when preparing/creating the Text FX.


There are screenshots and videos that demonstrate the beautiful effects that can be achieved with Text Candy.

Here's a parting snippet from the Visuals_Game_Title_Screen sample where the Title screen of a game is modeled, given what can be done normally, this takes the app from a "made in Corona look" to a "WOW, how'd you do that" look.

We might have a comprehensive tutorial on our howto site at a later date.
The Title Jumping Jack is created using this snippet

local Txt_Title = TextCandy.CreateText({
 fontName  = "FONT1",       
 x  = screenW*.5,      
 y  = screenH*.05,      
 text   = "JUMPIN'|JACK", 
 originX   = "CENTER",       
 originY   = "TOP",       
 textFlow  = "CENTER", 
 charSpacing  = -15,
 lineSpacing  = -65,
 showOrigin  = false,        

 startNow  = true,
 restartOnChange  = true,
 charWise  = true,
 frequency   = 250,
 rotationRange    = 5,
 xRange   = 8,
 yRange   = 10,
 delay   = 0,
 } )

 hideCharsBefore  = true,
 hideCharsAfter   = true,
 startNow  = true,
 loop   = false,
 autoRemoveText   = false,
 restartOnChange  = true,
 inDelay   = 0,
 inCharDelay  = 40,
 inMode     = "LEFT_RIGHT",
 InSound     = Snd_Beep,
 AnimateFrom  = { xScale = 0.01, yScale = 0.01, time = 1000, transition = easing.outQuad },

And here's how the button has been created
local Txt_Start = TextCandy.CreateText({
 fontName  = "Floraless",       
 x  = screenW*.175,      
 y  = screenH*.55,      
 text   = "START", 
 Color  = {255,255,0, 255},
 shadowOffX = 4,
 shadowOffY = 4,
 shadowAlpha = 128
Txt_Start:addBackground( display.newImage("Images/button.png"), 24,0, 1.0, 6,6 )
Txt_Start.rotation = -15
Txt_Start:addEventListener("tap", ButtonListener)

Note that the font is a true type font that is used for the buttons, where as a bitmap font is used for the Title.
These two fonts, are set up at the start of the code with
TextCandy.AddCharset  ("FONT1", "font_SmokyGlass_Big_Copper", "font_SmokyGlass_Big_Copper.png", "0123456789AÄBCDEFGHIJKLMNOÖPQRSTUÜVWXYZ'*@():,$.!-%+?;#/_", 25)
TextCandy.ScaleCharset("FONT1", 1.8)

TextCandy.AddVectorFont ("Floraless", "0123456789AÄBCDEFGHIJKLMNOÖPQRSTUÜVWXYZ'*@():,$.!-%+?;#/_", 24)

it should be noted that there are the characters with the Umlaut included in the text, Lua/Corona has an issue with not being able to display UTF-8 characters, only the ASCII characters are displayed, the accented Latin characters are supported. So you can have text like Garçon, Piére, Sãn Paolo, München etc. But they need to be added to the list of the characters available above.

and to ensure that the buttons/title keep animated

local Sin  = math.sin
local Time = system.getTimer

Runtime:addEventListener("enterFrame", function()
 local scale = 1.0 + Sin( Time() / 150) * .1
 Txt_Start.xScale    = scale
 Txt_Start.yScale    = scale
 Txt_Settings.xScale = scale
 Txt_Settings.yScale = scale
 Txt_Tutorial.xScale = scale
 Txt_Tutorial.yScale = scale

If you are a developer using CoronaSDK and want to add that little extra Oomph to your application, You definitely need Text Candy, it can make your app stand apart from all of the other apps. In fact these are the two hidden/less well known libraries that should be included into the official release of CoronaSDK by Ansca, till then every developer must purchase a copy of these two Candies, if you they are serious about development.

Software : Text Candy
Version : 1.0.08
Publisher : X-PRESSIVE.COM
Website : http://www.x-pressive.com
Platform : Corona SDK
Price : €39.95

However there is a special offer, where one can purchase one of the Libraries at full price and get the other at half price. Since both are priced the same, it is simply put a 25% off if both are purchased, however you do not have to buy them at the same time, if you have purchased one, you get a coupon code which can be used to provide the appropriate discount.

And we have a copy of TextCandy for one lucky winner, all you need to do
1. Follow @whatsin4me
2. Retweet the message "Read reviewme.oz-apps.com, follow @whatsin4me and RT this msg. You might win a copy of #TextCandy from #xpressive"

Disclaimer: X-pressive.com have made this offer available with the following conditions
1. If you are the winner, you shall respect the copyright and intellectual property of the developers and *NOT* distribute the lua source code of Text Candy to anybody. It is for you and is to be intended for use by yourself alone.
2. This is a complementary copy and there shall be no updates available unless you have purchased a copy of Text Candy
3. You shall have fun with Text candy... (we added that one, that was not from x-pressive.com, but I am sure they will want the same for you)

You can Follow us on Facebook by liking our page at