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:
- Code: https://github.com/roaminggamer/SSK2/tree/master/ssk2/extensions
- Docs: https://roaminggamer.github.io/RGDocs/pages/SSK2/extensions/
PS - I hope I wasn’t rude about the whole ‘passive’ thing. I’ve had my coffee now.