Text Candy and director change scene problem

When I try to change scene, from a copy paste code based on vector font, I get the following issue :
"
–> TEXT FX SYSTEM READY.
–> TextFX.AddVectorFont(): ADDED VECTOR FONT ‘Floraless’
–> TextFX.CreateText(): TEXT CREATED.
WARNING: Attempt to set object.alpha to 1.015 which is outside valid range. It will be clamped to the range [0,1]
–> TextFX.RemoveCharset(): REMOVING CHARSET ‘Floraless’…
–> TextFX.DeleteText(): TEXT DELETED. REMAINING TEXTS: 0
Runtime error
…rd/programmation/Corona/sandboxes/lib_text_candy.lua:288: attempt to index field ‘Sheet’ (a nil value)
stack traceback:
[C]: ?
…rd/programmation/Corona/sandboxes/lib_text_candy.lua:288: in function ‘RemoveCharset’
…rd/programmation/Corona/sandboxes/lib_text_candy.lua:302: in function ‘CleanUp’
…meguard/programmation/Corona/sandboxes/TextCandy.lua:57: in function <…meguard>
?: in function <?:214>
"

And this is my code :
<br><br>module(..., package.seeall)<br><br>---------------------------------------------------------------<br>-- GROUPS<br>---------------------------------------------------------------<br><br>local localGroup = display.newGroup()<br><br>---------------------------------------------------------------<br>-- VARIABLES<br>---------------------------------------------------------------<br>local w, h = display.contentWidth, display.contentHeight<br><br>---------------------------------------------------------------<br>-- DISPLAY OBJECTS<br>---------------------------------------------------------------<br><br>local title = display.newText("HOME", 0, 0, native.systemFontBold, 16)<br><br>------------------------------<br>-- TEXT CANDY<br>------------------------------<br><br>-- LOAD &amp; ADD A CHARSET<br>TextCandy.AddVectorFont ("Floraless", "0123456789AÄBCDEFGHIJKLMNOÖPQRSTUÜVWXYZ'*@():,$.!-%+?;#/_", 32)<br><br>-- CREATE A TEXT OBJECT USING THIS CHARSET<br>local MyText = TextCandy.CreateText({<br> fontName = "Floraless", <br> x = w*.5, <br> y = h*.5, <br> text = "THIS IS A CUSTOM TRUE TYPE FONT.",<br> originX = "CENTER", <br> originY = "CENTER", <br> textFlow = "CENTER", <br> charSpacing = 0,<br> lineSpacing = -4,<br> wrapWidth = 400, <br> showOrigin = true,<br> -- ADDITIONAL PROPERTIES YOU CAN USE WHEN CREATING VECTOR TEXTS:<br> Color = {175,175,175, 255},<br> fontSize = 32,<br> shadowOffX = 8,<br> shadowOffY = 8,<br> shadowAlpha = 128<br> })<br><br>---------------------------------------------------------------<br>-- FUNCTIONS and LISTENERS<br>---------------------------------------------------------------<br><br>local function touched ( event )<br> if event.phase == "ended" then<br> TextCandy.CleanUp() -- CLEAN UP *BEFORE* SWITCHING SCENES!<br> director:changeScene("home","fade", "black")<br> print("changeScene")<br> end<br>end<br><br>---------------------------------------------------------------<br>-- INIT VARS<br>---------------------------------------------------------------<br><br>local function initVars ()<br><br> -----------------------------------<br> -- Inserts<br> -----------------------------------<br> <br> localGroup:insert(title)<br> localGroup:insert(MyText)<br> <br> -----------------------------------<br> -- Positions<br> -----------------------------------<br> <br> title.x = 160<br> title.y = 20<br> <br> -----------------------------------<br> -- Colors<br> -----------------------------------<br> <br> title:setTextColor( 130,130,130)<br> <br> <br> -----------------------------------<br> -- Listeners<br> -----------------------------------<br> <br> title:addEventListener( "touch" , touched )<br> <br>end<br><br>---------------------------------------------------------------<br>-- CLEAN<br>---------------------------------------------------------------<br><br>function clean ( event )<br> -- DO NOT CLEAN UP HERE<br>-- btw, do you make the same advice for Particle Candy ?<br> print("cleaned")<br>end<br><br>---------------------------------------------------------------<br>-- NEW<br>---------------------------------------------------------------<br><br>function new()<br> <br> -----------------------------------<br> -- Initiate variables<br> -----------------------------------<br> <br> initVars()<br> <br> -----------------------------------<br> -- MUST return a display.newGroup()<br> -----------------------------------<br> <br> return localGroup<br> <br>end<br>

Thx for any help :slight_smile: [import]uid: 9328 topic_id: 8523 reply_id: 308523[/import] </…meguard>

I may be wrong, but I don’t think you need to call TextCandy.CleanUp() on a Vector Font as there is no associated bitmap to clean up [import]uid: 8366 topic_id: 8523 reply_id: 30573[/import]

Removing the cleanup indeed solved the error …Thx for the hint -though there’s no info about vector no need to clean up in reference page-

Maybe I should open an new topic :

I start to test deform and animation, and it’s - the xpressive way - simple, effective, fun and wowfactor. Really cool !

One question : animation are made to “animate these properties smoothly back and forth” (from the reference page): what if I don’t want to have back and forth (having a continuous rotation for instance) ?

[import]uid: 9328 topic_id: 8523 reply_id: 30600[/import]