[Resolved] display.newLine doen't work after inserting into display group

Hi
Im using the following code

mylinecount=mylinecount+1
myline[mylinecount]=display.newLine(arrx[counter],arry[counter],arrx[counter-1],arry[counter-1])
myline[mylinecount].width=3
myline[mylinecount]:setColor(R, G, B, 255 )
myline[mylinecount].name=“line”
disp_group:insert(myline[mylinecount])

It does not give me any error but cannot see the drawn line on the screen. But if you comment the disp_group line it works perfectly.
Is there a solution for this problem. is it because the myline is an array. [import]uid: 115284 topic_id: 25773 reply_id: 325773[/import]

Are you using more than one group? Do you have your background in a group? If the background is in a group is that group created AFTER dist_group?

If the answer to all 3 is yes, that’s your problem - if not, show more code please :slight_smile: [import]uid: 52491 topic_id: 25773 reply_id: 104215[/import]

You also need to remember that your x,y coordinates are going to be different inside the new display group. [import]uid: 7177 topic_id: 25773 reply_id: 104223[/import]

Its solve , the reason was simple the background was not inserted into the group and disp_group was initialized before the background , for some reasons when i moved the disp_group initialization after the background it works fine. thanks guys. [import]uid: 115284 topic_id: 25773 reply_id: 104354[/import]