Text not showing as expected

Using this:

local aboutText = display.newText(options) grp:insert(aboutText)

the text does not show (on a white background).

But, using this:

local aboutText = display.newText(options) aboutText:setFillColor(red) grp:insert(aboutText)

it does show, but as black letters, not red …

So, 2 questions:

  1. why do I need to set the fillcolor in the first place?

  2. why is the text not in red?

TIA,

   /Arie

OK. Digging deeper I found out that in setFillColor you can’t use ready made constants like “black”.

Instead, when using 3 values for RGB it does work.

Sorry for the noise. I’m a bit new here :slight_smile:

That’s cool.  Thanks for posting back when you worked it out.  This helps others in the same boat a lot.

Cheers and welcome to the community.

  • Ed (aka RoamingGamer)

The default simulator background is black and as such the default text is white. When you make your background white, you effectively are drawing white on white and can’t see it. Using :setFillColor() is the correct thing to do. But you can also set the default color for display objects using display.setDefault(). See: http://docs.coronalabs.com/api/library/display/setDefault.html

Rob

OK. Digging deeper I found out that in setFillColor you can’t use ready made constants like “black”.

Instead, when using 3 values for RGB it does work.

Sorry for the noise. I’m a bit new here :slight_smile:

That’s cool.  Thanks for posting back when you worked it out.  This helps others in the same boat a lot.

Cheers and welcome to the community.

  • Ed (aka RoamingGamer)

The default simulator background is black and as such the default text is white. When you make your background white, you effectively are drawing white on white and can’t see it. Using :setFillColor() is the correct thing to do. But you can also set the default color for display objects using display.setDefault(). See: http://docs.coronalabs.com/api/library/display/setDefault.html

Rob