Text Not Appearing In Front of Display Object

How do you make it so the text appears before the display object? I’ve tried placing the text code before and after the display object code, but they both don’t work. Here is my nonworking code:
[lua]local myText = display.newText( “Level Select”, 63,35, “American Typewriter”, 35 )
myText:setTextColor(255,0,0)

local bt01 = display.newImage(“buttonBlueSmall.png”)[/lua]

Does it make a difference that I have a touch function for my display object? [import]uid: 30901 topic_id: 5972 reply_id: 305972[/import]

Try putting the text in a group and send that group to the front

local textGroup = display.newGroup()  
  
textGroup:insert(myText)  
textGroup:toFront()  

But then that text would be in front of everything else in your game [import]uid: 30185 topic_id: 5972 reply_id: 20498[/import]

It still doesn’t work… hmm… Does it matter that the screen is in a module? But why would that make a difference? This is really frustrating… [import]uid: 30901 topic_id: 5972 reply_id: 20512[/import]

It doesn’t need to be in a group to be called with toFront.

When you add an image object 1, it is automatically at the front. If you call toFront() immediately after drawing image object 1 it does nothing. You need to call toFront after calling image object 2:

[lua]img1 = display.newCircle(100, 100, 30)
img1:setFillColor(255, 0, 0)
img1:toFront() – Does nothing as img1 is already at front
img2 = display.newRect( 80, 100, 50, 50 ) – Now img2 is at front because it was just created
img2:setFillColor(00, 0, 255)
– img1:toFront() – Uncomment this line to see the difference[/lua]

If you’re always adding stuff to the screen then you want to call toFront on the object in the a frameevent listener to make sure it’s always at the front on every screen refresh. [import]uid: 11393 topic_id: 5972 reply_id: 20522[/import]