New Candy Tool: Text Candy for Corona (50% off coupon inside)

As a reply to mike4's thread, we'd like to announce the release of a new Candy tool. Quite a few people got scent of it during the last weeks, so here's the full story, along with detailed info:

WHAT IS TEXT CANDY FOR CORONA?
Text Candy is a straightforward to use and extremely powerful text engine to create, display and animate all kind of decorative bitmap texts within your game. It's main purpose is the ability to display bitmap fonts (which provide by far a better look than monochrome true type fonts) and easily animate texts in many fancy ways.

Text Candy comes with lots of premade, high quality and ready-to-use bitmap fonts but also lets you use your own bitmap fonts. Using bitmap chars allows you to keep full control over look and style of your texts. Display 3D-style chars, apply smooth drop shadows, bevels, reflections, specular effects, nice color gradients, multi-colored, burning or smoking texts -whatever you imagine!

Text Candy is the perfect solution to display and animate your game title graphics and all kind of eye-catching in-game texts such as score displays, highscore lists, credits, text notes, scrollable texts, marquees, headlines and more. Create animated texts using beautyfully pre-rendered bitmap fonts with a single line of code only!

All text objects can be animated at char level, resulting in awesome, professional looking, arcade-style text effects. Text Candy provides many premade animation effects that can be applied to any text object with a single line of code but also features an easy to use API to create any kind of effect you can imagine.

Applied text animations can be started manually at any time, but you can also let Text Candy handle this for you to animate a text object automatically each time a text changes. Text Candy supports multi-line texts, automatic word wrapping and several text alignment methods. You'll be amazed how easy it is to use!

What you should know:
The purpose of Text Candy is to display eye-catching, animated text messages in your game like title screens, score display, game over or ingame-messages, loading screens etc. It focusses on animated texts, so it is not meant for huge amounts of texts or text-heavy projects.

DEMO VIDEO
Note: this video shows the "Features Demo" sample code, which is also included in the package -as well as many other sample codes and a collection of several dozens of premade bitmap fonts.

WATCH VIDEO

REFERENCE & DETAILED DESCRIPTION

THIS WAY to the online manual and a complete list of features.

LIMITED TIME COUPON CODE

Due to the first release of this library, we're offering a coupon code to get Text Candy for 50% off (limited time only) - just enter TEXTS4CORONA

As always, we're happy to get any kind of feedback, usage experience and feature suggestions from you.

Regards,
Mike

If I am already purchased the Particle Candy, will have even better offer ?

i've already bought Text Candy for about 2-3 days and now there's a discount!? I am a little bit disappointed.

-Oliver

Yahooooo....love it, Glyph Designer / Angelcode support?

edit: it seems a tool is needed to convert a BMFont text file to a .lua spritesheet definition?

Thanks Mike!

Bought, and ready to dig in.....

it's a Buy....

Any chance of a deal for both Candy tools?

Now that I started to look at this, how are you generating your font sheets?

From looking at things, I hope you aren't individually exporting single characters from Photoshop, and using Zwoptex to create a font sheet....Which is what I think is going on.

How about some detailed info on how to create the font sheets, and corresponding .lua files that are necessary?

I would love to use my tool of choice for creating bitmap fonts, Glyph Designer from 71squared.

http://glyphdesigner.71squared.com/

While you're there, take a look at their (not free, but only $7.99) particle editor for iOS.

http://particledesigner.71squared.com/

I think it would be great if you could figure out a way to get the data you need from Particle Designer out, to be able to drop right in to Particle Candy.

Any tips on how best to use the scaling with a higher res display dynamically? (e.g. retina @2x).

Congratulations on the release!!! License purchased. Thanks

Great news! Just purchased a license. I've been using a beta version of Text Candy and can attest to its awesomeness in combination with Corona.

As Mike4 mentions, I, too, would like some more info and/or docs on how to generate my own font sheets and data. I've been using one of the provided fonts, and while nice it's not quite what I need for my game.

Glyph Designer support, or at least a tool to convert GD to the Text Candy lua format would be ideal for me.

Thanks for any info. you can provide.

[TUTORIAL] CREATING YOUR OWN BITMAP CHARSET

Creating bitmap charsets is basically very easy. There are just a few steps to do -once you are familiar with this process, a bitmap charset is done in about 10-15 minutes only (and can be reused in any of your future apps then).

STEP 1 - OPEN YOUR DRAWING APP
Use your favorite drawing application like Photo Shop, Paint Shop, Gimp etc. and create a new, transparent image that is big enough to hold all the chars you want to use (any size will do).

STEP 2 - ADD YOUR TEXT
Now place a text in there that contains all chars you want to use in your game. Choose a font size that fits your need best (depends on wether you want to create title logo chars, ingame texts, use them in an iPhone or iPad app etc...) Just make sure there is enough spacing between the chas, so you can apply a cool drop shadow, glowing effect etc. to the chars without overlapping them.

STEP 3 - APPLY EYE CANDY
Now apply any cool filter you like to -adding 3D bevels, shiny effects, chrome filters, apply a texture, a drop shadow, outlines, whatever your drawing application (or your creativity) is capable of.

STEP 4 - SAVE ALL CHARS
Now cut out each char and save it to disk as an individual image file (png). There is no need to cut them out properly because Zwoptex and TexturePacker both provide image cropping (automatically getting rid of empty space around each image). Name each char like "a.png", "b.png" etc. -as seen in the included font pack. This naming convention ensures that Zwoptex or Texturepacker place your chars in alphabetically order on the sprite sheet.

STEP 5 - IMPORT CHARS INTO TEXTUREPACKER OR ZWOPTEX
Now open either Zwoptex or TexturePacker (last mentioned provides a free version and is available for Windows, too) and import your chars. Enable cropping (so that any empty space around the chars is removed) and use a spacing of ~2 pixels between the single images. Also enable "sort by name", so that the chars are ordered in alphabetical order in the exported data sheet.

STEP 6 - EXPORT YOUR TEXTURE
Now export both, the texture that contains all the chars and the data file (sprite sheet). Place both in your project's root folder to avoid any path problems.

STEP 7 - LOAD YOUR CHARSET
Load the font into your application using

1
TextCandy.AddCharset ("fontName", "dataFile", "fontImage.png", charOrder

Mike? I know it's a bit cheeky but is there a bigger discount for PC users?

Cool ! I'm eager to test it :)

Just one question :

Is this tool ok for "paragraph" management

(I know the answer is in your sample code, but ...)

@dweezil: the coupon provided above is valid for a week only, while Particle Candy owners will then still be able to get a discount. There will be more info on this within the next couple of days.

Antheor, I am not sure what you mean exactly with "paragraph management", but you can define a maximum width for a text object, once the text exceeds this width, it will be automatically broken to the next line, for example.

Hi x-pressive,

Rob2 (and probably some other people) would like to be able to use AngelCode-style bitmap fonts (as exported from Glyph Designer) with TextCandy.

I already have my own library for parsing and using these fonts, but I am not a TextCandy user myself, so I can't test the glue to get these AngelCode font definitions loaded into TextCandy. So maybe you can help Rob2 out... Here's a rough draft I've hacked up for something that might work for taking a font as loaded by my own library ("BMF") and using it from TextCandy:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
-- take an already-loaded BMF font object and import it as a TextCandy charset
function AddCharsetViaBMF( name, font )
  local chars = [];
  for k, v in pairs( font.sprites ) do
    chars[ v.frame ] = k
  end
  AddCharset(
    name,
    font.spritesheets[0].file,
    font.spritesheets[0], -- is there a way to pass the spritesheet definition directly rather than via a module file?
    table.concat( chars ), 
    font.chars[' '].xadvance,
    nil,
    font.info.lineHeight
  )
  for k, v in pairs( font.sprites ) do
    SetCharYOffset( name, k, font.chars[k].yoffset )
  end
end

@x-pressive.com

Did i mentioned that i bought both Particle Candy & Text Candy a few days ago...

so it would be very nice to get an answer regarding a discount for "Text Candy" for users who bought text candy too early:-)

Sorry Oliver, would reply to you yesterday, but it was quite late then and I had already gone through a 16 hours day.

Well, let me explain this in detail: each time we offer a coupon code, we also receive complaints from one or another user why we did not let them know before -same when a discount ended. Well, first, we sometimes decide on a daily base to be as flexible as possible here. There was no fixed date for the premiere event as you bought it, so I couldn't let you know (I would, otherwise, of course). Second, we can't stop purchasing our products one week before a coupon goes out just not to offend any users. Third, you ALL know that we're *always* willing to help, providing as much (personal!) support as possible -even regarding to questions that have nothing to do with our products itself. We put an extreme amount of work and time into our products and the regarding support -in fact so much that we can't produce any own titles at the moment. We are working 14-16 hours per day -fulltime, not just as a hobby! Considering this, the prices of our products are more than fair! Sell just one app and you probably earn the tenfold that you spent purchasing the libs. So I can't understand why people complain about missing a discount while the original price is still more than fair and does not reflect in any way the amount of work we put into (or the amount of work you'll save yourself). This sometimes disappoints me a little bit... but as I said, we're always willing to help, so just drop a mail and we'll come towards you.

@p120ph37: using Glyph Designer should be no problem if it exports a texture and a Corona compatible .lua data sheet as Zwoptex and TexturePacker do. Unfortunately, it seems that it doesn't yet.

We are not familiar with it's output format and couldn't find any specs on their website but we could add a function to load a charset passing a table instead of reading a .lua data sheet file. This table should be in the same format as a Corona sprite sheet. So all it needs would be a conversion routine to convert the Glyph Designer data to a Corona sprite sheet table, then you could add a charset by passing this data table to Text Candy.

@x-pressive

The Glyph Designer definition format is just the AngelCode BMF format, which is somewhat documented here:
http://www.angelcode.com/products/bmfont/
and here:
http://www.gamedev.net/topic/284560-bmfont-and-how-to-interpret-the-fnt-file/page__view__findpost__p__2785731

You can also find example .fnt files as produced by Glyph Designer in this demo:
http://ember.awirtz.com/bmf.zip

As I mentioned, I don't own TextCandy myself, so it would need to be one of your users or you who would do the final integration work, but allowing a standard spritesheet definition table as an option instead of a .lua file would certainly make it much simpler to write wrappers for importing other font formats into TextCandy.

Also, do you have any plans to support per-character x-offset and x-advance properties like you support per-character y-offset? What about kerning (you can see this in the impact64.fnt file, and it is very noticeable on-screen with letter combinations like "AVA")? These are data which are available in Glyph Designer produced fonts, so it would be nice for TextCandy to be able to utilize them.

Having looked into this in some detail it seems Angelcode is the widely supported format for bitmap fonts and having Text Candy read these files would certainly make windows users happy
http://www.angelcode.com/products/bmfont/ as well as those using Glyph Designer.

This would also facilitate the support for Kerning which is pretty fundamental to good looking typography and is a big omission, something which is strikingly obvious from your video.

Anyway I await my download link having just purchased :)

oh that was a snap post ..never mind.

To Oliver ( forgive me for commenting )

I know it can be frustrating to miss a coupon, but I can't help adding that it's a little unfair to complain about xpressive ability to answer.

I hardly met any developer so willing to answer, giving always helpful infos, whatever the noob level of the question.

Anyway, if you're new to Particle Candy (I read you bought it just a few days ago), your frustration will soon vanish once you realize how cool it is :)

To Antheor

I will forgive you:-)

@Rob / p120ph37: Kerning is already supported, you can specify any char spacing, as well as line spacing. Adding individual x-offsets for each chars is no problem at all.

p120ph37, could you drop a mail to support at x-pressive.com so we can discuss the integration of Angelcode into Text Candy in detail then.

What you are referring to is really just letter-spacing or tracking. Kerning involves the definition of inter letter space adjustment for particular letter pair occurrences which is then automatically applied to text as it is laid out. A well designed modern font may well have hundreds of kerning pairs defined which are an integral part of the typographer's vision. I guess it's not the end of the world but it's a fairly important aspect of digital typography.

Anyway it looks like you are already on the case with p120ph37 so I will shut up and think myself lucky to have what Text Candy already is ------ pretty bloody magic :)

I've noticed a possible bug in Text Candy when using BOTTOM alignment. Here's the code:

local titleText=textcandy.CreateText({
fontName="TitleFont", x=display.contentWidth/2, y=100,
text="Raving",
charSpacing=-22,
originX="CENTER",
originY="BOTTOM",
showOrigin=true})

I notice that, although the reference point is at the bottom of the group, the text is arranged with all of the tops of the character boxes level. Hence, since the characters are differing heights, the text does not line up along the baseline.

By making the following change around line 1245 in lib_text_candy.lua I find that the bottoms of the characters will line up:

--Img.y = y + Char.height *.5
Img.y = y + Group.totalHeight-Char.height*0.5 -- AB 28 Mar 2011

Using this fix means that I don't have to apply y offsets to a large number of letters since the text will print along a constant baseline; I'll only need yOffsets for characters with descenders.

Just in case this isn't clear, here's a short clip that demonstrates the problem: http://twit.io/2Hh

Regards

Andy Bower

A text object's origin property has nothing to do with the char baseline alignment itself (which is always the char's center with the current version). The text object's origin property just determines how your text object is positioned on screen.

Aligning chars at a bottom line could be problematic for letters like "g", "q", "y" etc. Text Candy aligns chars using their center by default, but it might be more convenient to let the user decide, because it strongly depends on the charset used.

We'll add another property to allow chars to be placed either on their top, center or bottom line.

@x-expressive.com. I agree that the bottom alignment idea isn't perfect but it seems to me that the vast majority of characters will be easier to line up with such an option. Aligning to the vertical centre only works well if the character boxes are all equal sizes. This would make manually creating a font a lot harder since the individual characters images would need to be cut out accurately (which isn't what you suggest on your tutorial page)

Anyway, thanks for the offer to add bottom alignment as a property; I think it will help significantly.

Of course, I would also be keen to be able to use GlyphDesigner fonts, which presumably would solve the issue completely. Any news on whether this might be possible in a future version? FWIW, I am not that interested in whether TextCandy supports true kerning (i.e. with multiple letter pairings) since I accept that really TC is for text effects rather than high quality typography. My main interest is being able to create fonts with special effects quickly.

I have noticed a black screen when trying to load TC director class sample code.

More info on that issue if needed.

bowerandy: Glyph Designer support is on top of our to do list. However, it may take a couple of days since we're quite busy at the moment and don't want to release any half-baken versions and want to give it some tests first.

Antheor: What Director version are you using? Did you check if the build.settings may need to be changed to fit your target device?

Well, I have just tried to open your main.lua in the sample folder where you put director class.

Anyway, it seems I'm alone having the error. So I'll try to check the terminal and come back with full infos :)

BTW, TC deserves its own 3rd party tools forum, no ?

TC deserves an Oscar ! :)

@Antheor

Either

copy lib_text_candy.lua to the director sample directory

Or

change line 7 in the director sample main.lua

from

TextCandy = require("lib_text_candy")

to

TextCandy = require("../lib_text_candy")

so that the Text Candy library gets found

Yes, both libs should always be placed in your project folder, also edit the require path then.

The reason why the packages aren't shipped like this is that chances would be high that we accidentally ship an outdated library version in one of the sample folders, so we just include one copy of the library. So you'll have to place a copy within each sample folder before using it the first time.

Thx evs and xpressive. It indeed solved the problem :)

Hi All,

Has anyone been able to run any of the samples on a real device? I get a blank black screen when I try to run any of the samples. I made the suggested changes to the TextCandy.AddCharset

Nathan.

I haven't run any of the samples on the device, but I have created a score object, and my company logo screen using Text Candy, and they run flawlessly on the device.

mike4,

My own project and textcandy samples run fine in the Corona simulator but fail in the xcode simulator and an ipod touch v4.21. Using Corona.268, director class and ui.

Nathan.

I would like to use TC for displaying 1-3 short textfields of about 25 characters (same font always, with a size of 18) in a game that has rapid scene changes (something like Moron Test). I am restricted to change scenes quickly, with a delay of less than 500 ms. This is important for me.

I have already implemented a bitmap font solution but I've abandoned it because of the time it needs to construct the sprites (about 700-1200 milliseconds), althought the spritesheet remains constantly in memory.

Do you think that Texture Candy can give better results?

PS: A trial version would be ideal for such situations!

It works on the device for me
I make sure EVERYTHING is in the same folder to be on the safe side

Works great for me too for a number of text displays in my game (including device build). Note the requirement that libraries be placed in the root directory (in the same folder as main.lua)

Whoops, double post

Hi,
bought it and it's great :)
But how do you do a line break in a displayed text?i have something like "text = (points .. " POINTS"),", and i wand to insert a line break before "POINTS".

Use the pipe symbol | for line breaks

text = (points .. "|POINTS")

Please excuse the delayed reply, folks -we're currently not at our office, so it's hard to manage things from here :-(

@Magenda: if you need a very quick way to display texts (or sprites in general), you could try to create them before and set them to invisible, then make them visible just in time, using the .isVisible property. This should be faster than creating and removing objects. That's just a general hint, not specific to Text Candy.

@x-pressive

Yes, I use this method for other graphics in my game and it works nicely. The thing with the text is that I need 2-3 textfields for *each* level of the game and I am planning to build 30+ levels. As a result, ~100 textfields (x20-25 chars) would require too much memory and processing time to be preprocessed. If I can cap the bitmap font thing to <500 ms it would be ok for processing the sprites on the fly.

This is the reason I was asking about the TC speed.

Cheers

Has anyone used Text Candy on Android - if so what is the performance like (compared say to IOS)?

What is the performance like compared to using the basic font/text functions in Corona?

I already purchased Particle Candy a while ago and trying to decide whether the Text Candy package will be worthwhile for me.

I don't so much want the fancy effects, just want to know what it is like as a text manager and how fast it is. I currently use my own custom bitmap font renderer, but it may not be as fast as it coulde be.

Thanks!

Looking to purchase Particle Candy and Text Candy. Before doing so though I wanted to know if a bundle discount could be had or if my only option is to buy them for the full price (which I'd probably do separately in two different transactions in that case).

We will definately offer a bundle discount soon (as soon as the next Particle Candy update went out). Until then, the Text Candy coupon code (50% off) will still be valid.

I was wondering if you plan on releasing any more font packs?

Yes, there will be additional font packs, too, of course. Those will be "general" fonts, however. To achieve that "special look" that exactly fits to your game or title screen, you should also not hesitate to make your own. Since you can re-use your fonts in any of your projects, it's really worth the little effort.

views:3763 update:2011/10/13 16:39:51
corona forums © 2003-2011