hello i’m new in corona sdk
i have an object group and i want to slide this group and drag item who are in this group , is it possible to do this?
for example :
local widget = require( “widget” )
local scrollView
local icons = {}
local function iconListener( event )
local id = event.target.id
if ( event.phase == “moved” ) then
local dx = math.abs( event.x - event.xStart )
if ( dx > 5 ) then
scrollView:takeFocus( event )
end
end
return true
end
local function showSlidingMenu( event )
if ( “ended” == event.phase ) then
scrollView = widget.newScrollView
{
width = screenW,
height = 100,
scrollWidth = 1200,
scrollHeight = 100,
verticalScrollDisabled = true
}
scrollView.x = display.contentCenterX
scrollView.y = 100
local scrollViewBackground = display.newRect( 600, 50, 1200, 100 )
--scrollViewBackground:setFillColor( 0, 0, 0)
scrollView:insert( scrollViewBackground )
--generate icons
for i = 1, 20 do
icons[i] = display.newCircle( i * 56, 50, 22 )
icons[i]:setFillColor( math.random(), math.random(), math.random() )
scrollView:insert( icons[i] )
icons[i].id = i
icons[i]:addEventListener( “touch”, iconListener )
end
end
return true
end
Runtime:addEventListener(“touch”, showSlidingMenu)
I want to drag the circles that are in the bar and to be able to slide too