Text won't display

Hey guys,

I was wondering if any one else is having the same problem? No matter how i use display.newText, the text just won’t appear in my lua file. I am using the director class. Any one have a clue about this? Is it a bug?

[import]uid: 67534 topic_id: 23156 reply_id: 323156[/import]

Definitely not a Corona bug, sounds like something may be up with your code.

Care to post it up? [import]uid: 84637 topic_id: 23156 reply_id: 92642[/import]

Make sure you have layered your code correctly. With director, whatever object you add to the display group last will show up on top. Here is an example:

[lua]local localGroup = display.newGroup()

local randomTxt1 = display.newText(whatever…)
localGroup:inesrt(randomTxt1)

local randomTxt1 = display.newText(whatever…)
localGroup:inesrt(randomTxt2)[/lua]

In the top system, the randomTxt2 will show up on top since it is lower in the code structure. Hope this helps.

Regards,
Jordan Schuetz
Ninja Pig Studios [import]uid: 29181 topic_id: 23156 reply_id: 92684[/import]

This is it, i have resulted in using a transparent background for the time being, i’m pretty sure im not doing anything wrong?

[lua] module(…, package.seeall)

_W = display.contentWidth
_H = display.contentHeight

function new()
local localGroup = display.newGroup()

local background = display.newImage(“bg2.png”)

local title = display.newText(“Best score”, 80, 80, “Helvetica”, 30)
title:setReferencePoint(display.CenterReferencePoint)
title:setTextColor(255,255,255)

return localGroup
end [/lua]

Its the same as as my other files but the background is on the top. [import]uid: 67534 topic_id: 23156 reply_id: 92810[/import]

You should be inserting your display objects into the localgroup

[code]
module(…, package.seeall)

–use locals
local _W = display.contentWidth
local _H = display.contentHeight

function new()
local localGroup = display.newGroup()

local background = display.newImage(“bg2.png”)
localGroup:insert(background)

local title = display.newText(“Best score”, 80, 80, “Helvetica”, 30)
title:setReferencePoint(display.CenterReferencePoint)
title:setTextColor(255,255,255)
localGroup:insert(title)

return localGroup
end
[/code] [import]uid: 84637 topic_id: 23156 reply_id: 92811[/import]

Ah ok I’ll give that a go. Thankyou very much for your help! [import]uid: 67534 topic_id: 23156 reply_id: 92881[/import]