Wouldn't it be lovely if display newText took the text colour as a parameter

Tip: If you wanted to take that one step further, you could extend/override display.newText() by executing this code once:

**UPDATE** I must have misread Michael’s post.  :wacko:**   He already did what I’m suggesting below with a slightly different signature.**

-- Execute this code once only before doing any work in your game/app local display\_newText = display.newText function display.newText( ..., color ) color = color or {1,1,1} local text = display\_newText( unpack( arg ) ) text:setFillColor( unpack( color ) ) return text end

Now you can use display.newText() like this if you want:

local myText = display.newText( "Hello World!", 100, 200, native.systemFont, 16, {1,0,0} )

SSK uses this and other extension techniques to extend certain key Corona libraries:

PS - I hope I wasn’t rude about the whole ‘passive’ thing.   I’ve had my coffee now. 

Ah yes, this is what I was meaning really… useful to know - thanks

Hehe, no, it was a fair point!  I run a software company so I ought to know!

fwiw, this type of override is “easier” if you abandon the legacy multi-argument format in favor of the current table-options format

just call your override with a few extra table parameters, pass the same table to the original newText (which will just ignore any unrecognized parameters), then parse your new parameters, fe:

display.oldText = display.newText function display.newText(options) local t = display.oldText(options) t:setFillColor(unpack(options.color)) return t end

Belatedly - many thanks Dave, that’s really helpful