function scene:create( event )
local screenGroup = self.view
local GUI = display.newGroup()
screenGroup:insert(GUI)
local background = display.newImageRect(GUI,“home.png”,_W,_H)
background.x = display.contentCenterX
background.y = display.contentCenterY
local goldImage = display.newImage(GUI,“gold.png”,10,15)
local goldText = display.newText(GUI,“coins”, 0, 0, “Antonio-Bold”, 30)
goldText.x = 100; goldText.y = 100;
local getCoins = display.newImage(GUI,“getCoins.png”)
getCoins.x = _W /2; getCoins.y = 390;
local nextBtn = display.newImage(GUI,“nextBtn.png”)
nextBtn.y = 390; nextBtn.x = 650;
local plane1 = display.newImage(GUI,“plane1.png”)
plane1.x = 100; plane1.y = 220;
local plane2 = display.newImage(GUI,“plane2.png”)
plane2.x = 300; plane2.y = 220;
local plane3 = display.newImage(GUI,“plane3.png”)
plane3.x = 500; plane3.y = 220;
local plane4 = display.newImage(GUI,“plane4.png”)
plane4.x = 700; plane4.y = 220;
local plane5 = display.newImage(GUI,“plane5.png”)
plane5.x = 900; plane5.y = 220;
local scrollView = widget.newScrollView
{
left = 0,
width = _W,
height = _H,
verticalScrollDisabled = true
}
scrollView:insert(plane1)
scrollView:insert(plane2)
scrollView:insert(plane3)
scrollView:insert(plane4)
scrollView:insert(plane5)
end
The scroll view overlaps the entire scene and comes with a white patch (as the background) …
I only want the scroll view applied to the 5 images which should be displayed in the centre of the screen …