Hello,
I have been trying to spawn a display group in my game using a spawn function. Actually i need to spawn one display group at a time, my code is not working, Please help
bar1 = display.newGroup( ) colort1 = display.newRect(bar1,0,hi\*4+200,wi,20) colort1.x = colort1.width/2 - colort1.width colort1:setFillColor(200/255,55/255,55/255) physics.addBody(colort1,"static",{}) colort1.isSensor = true colort2 = display.newRect(bar1,0,hi\*4+200,wi,20) colort2.x = colort1.x + colort1.width colort2:setFillColor(55/255,171/255,200/255) physics.addBody(colort2,"static",{}) colort2.isSensor = true local spawn = function(type) local barr = display.newGroup(type) barr.x = display.contentWidth/2 barr.y = 20 return barr end spawn(bar1)
Thank You
Kallol