-
Keeping my text vertically centered
So I currently have this expression on my text:
idx = 0
var txt = text.sourceTextif (txt.indexOf(' ') > 0 ){
txt = txt.replace(/\s/g, '')
sp = text.sourceText
outStr = ""
n = sp.indexOf(" ")
while (idx < txt.length){
if (idx > 0) outStr += "\r"
outStr += txt.substr(idx,n)
idx += n
}outStr
}
It’s taking the sentence I enter and putting every new word on a new line.What I need to add now is something to make sure the text stays vertically centered with every new line added. I’ve tried doing something like this
var a = 0;
var b = 2.9285;
transform.anchorPoint = [a,b];
but that only works when it is placed in the specific anchor point expression rather than the one on the source text.Any questions or help is much appreciated!
Thanks,
Nathan.