Hey guys, can anyone help me? I am really stuck on the drag me example app. I am trying to replace the blocks with pictures, but for the life of me I can’t figure out how. I have searched the tutorials, and I understand what’s going on, I am just not sure where or what script to use to spawn 3 or more images of different sizes instead of the 3 blocks with rounded edges that are spawned. I have tried display.newImageRect, but with no luck! Big headache. Please help!
Thanks.
SM [import]uid: 79586 topic_id: 16250 reply_id: 316250[/import]
Just quickly this works:
[lua]-- Iterate through arguments array and create rounded rects (vector objects) for each item
for _,item in ipairs( arguments ) do
local button = display.newImageRect( “icon.png”,114,114, item.x, item.y, item.w, item.h, item.r )
–button:setFillColor( item.red, item.green, item.blue )
button.strokeWidth = 6
–button:setStrokeColor( 200,200,200,255 )
– Make the button instance respond to touch events
button:addEventListener( “touch”, onTouch )
end[/lua] [import]uid: 58922 topic_id: 16250 reply_id: 60493[/import]