I am running into an error when trying to apply animations to specific characters (not the complete text string). Documentation says " each char can be accessed using MyText[2][n], where [n] is the index number of the char (wich ranges from 1 to the number of chars visible on screen). Spaces are not drawn as chars, they are simple gaps only."
I am trying to apply animation to scene.MyText[2][1], but i get the following error:
runtime error - "attampt to call method ‘applyAnimation’ (a nil value)
My goal is to animate the characters of just my name, so I would like to have characters, 6 -9 be animated, but i’m running into this runtime error even specifying just 1 character.
Here is the excerpt from my code and thank you very much in advance for your help.
– CREATE A TEXT OBJECT USING THIS CHARSET
scene.MyText = TextCandy.CreateText({
fontName = “04B_19”,
x = screenW*0.05,
y = screenH*0.76,
text = “Hello Adam”,
originX = “LEFT”,
originY = “TOP”,
textFlow = “LEFT”,
fixedWidth = screenW*0.9,
fixedHeight = screenH*0.2,
charSpacing = -5,
lineSpacing = -4,
wrapWidth = screenW*0.90,
showOrigin = false,
})
– ADD A BACKGROUND GRAPHIC
scene.MyText:addBackground( display.newImage(“background.png”), 16,16, 1.0, 0, 0 )
– APPLY IN- AND OUT-TRANSITION
scene.MyText:applyInOutTransition({
hideCharsBefore = true,
hideCharsAfter = true,
startNow = true,
loop = false,
autoRemoveText = false,
restartOnChange = true,
– IN TRANSITION
inDelay = 0,
inCharDelay = 50,
inMode = “LEFT_RIGHT”,
AnimateFrom = { xScale = 1.0, yScale = 1.0, time = 500, transition = easing.linear },
})
– APPLY ANIMATION *** this is where i have problems
– when applying animation to scene.MyText[2][1]
scene.MyText[2][1]:applyAnimation({
interval = 1,
startNow = true,
restartOnChange = true,
delay = 3000,
duration = 0,
charWise = true,
autoRemoveText = true,
frequency = 250,
startAlpha = 1.0,
alphaRange = 0.25,
xScaleRange = 0.25,
yScaleRange = 0.25,
rotationRange = 25,
xRange = 10,
yRange = 10
})