How to add label(text) to images?

In corona SDK how to add label(text) to images

I have created my image as follow

 local item = display.newImageRect('images/foo.png',70,70);  
 item.x = 50;  
 item.y = 50;  

How to add a text to the image?

Many Thanks [import]uid: 8519 topic_id: 11440 reply_id: 311440[/import]

Hi 0000bs

Try to use code below

local gamegroup display.newGroup()
local item = display.newImageRect(‘images/foo.png’,70,70);
item.x = 50;
item.y = 50;
local myText = display.newText(“Hello World!”, 70, 70,16)
myText:setTextColor(255, 255, 255)

gamegroup:insert(item)
gamegroup:insert(myText)

cheer
Mate :wink: [import]uid: 58733 topic_id: 11440 reply_id: 41442[/import]

Many Thanks sumate_it

it works fine

pst: there is a typo (missing “=”) in this line:

local gamegroup = display.newGroup()   

best regards :slight_smile:
[import]uid: 8519 topic_id: 11440 reply_id: 41847[/import]