How do I make a function like newText that will automatically add a shadow?

I was trying to create a function that will basically make two lines of text, one in black, and the other in the color of one’s choice, slightly above and/or to the left.

I tried ripping apart ui.lua and Jon Beebe’s implementation, but I haven’t come up with a working result.

Basically I want: local scoreLabel = newRetinaText( "Score: 0", 305, 15, "Helvetica-Bold", 20, 255, 255, 255, "right", textGroup )

To have a shadow without having to repeat every line twice just to add those shadows. [import]uid: 6084 topic_id: 6720 reply_id: 306720[/import]

how about…

[lua]local function newShadowText(txt, x, y, font, size, r,g,b,align,group)

local g = display.newGroup() – holder for shadow+text

local shadowTxt = newRetinaText( txt, x+1, y+1, font, size, r, g, b, align, group )
local labelTxt = newRetinaText( txt, x, y, font, size, r, g, b, align, group ))

g:insert(scoreShadow)
g:insert(scoreLabel)

return g

end

local scoreLabel = newShadowText( “Score: 0”, 305, 15, “Helvetica-Bold”, 20, 255, 255, 255, “right”, textGroup )[/lua] [import]uid: 6645 topic_id: 6720 reply_id: 23454[/import]