I come from a PHP background, where making code reusable is simple. My question is probably extremely simple but cant seem to find the answer in the docs. If I want to reuse a block of code how would i do this? background of the situation is:
i have 5 strings.
text1 = “line1”;
text2 = “line2”;
text3 = “line3”;
I want to fade this text in and out using calls similar to
timer.performWithDelay(3000, displayVal(text1, 50, 150) );
timer.performWithDelay(3000, displayVal(text2, 30, 150) );
timer.performWithDelay(3000, displayVal(text3, 40, 150) );
local function displayVal(text, x, y)
textBox.x=x;
textBox.y=y;
textBox.text=text;
transition.to(textBox, {time=1000, alpha=1})
transition.to(textBox, {delay=3000, alpha=0, time=1000})
end [import]uid: 6317 topic_id: 914 reply_id: 300914[/import]