Hello Everyone !
Im facing a weird problem. Im making a game that requires scrolling a background. But the scrolling ( by changing group.y ) behaves different in Runtime and CreateScene. Here is an example.
[lua]…
local bg, gameGroup
local function scroll()
gameGroup.y = 0
end
– Called when the scene’s view does not exist:
function scene:createScene( event )
local group = self.view
gameGroup = group
bg = display.newImage(“bg.png”)
bg:setReferencePoint(display.BottomLeftReferencePoint)
bg.x = 0 bg.y = _H
group:insert(bg)
– God method
scroll()
end
– Called immediately after scene has moved onscreen:
function scene:enterScene( event )
local group = self.view
– Bad One 
–Runtime:addEventListener(“enterFrame”, scroll)
– INSERT code here (e.g. start timers, load audio, start listeners, etc.)
end[/lua]
When I run scroll via Runtime, position of my group varies from image size, and its never on bottom. Im using 320 x 1920 image.
When I call scroll() Its ok, bottom of my image is on the bottom of the screen so in _H.
Any ideas what am I doing wrong ? Ive tried billions things, and my head is burning.
Best regards!
[import]uid: 77868 topic_id: 19931 reply_id: 319931[/import]
[import]uid: 77868 topic_id: 19931 reply_id: 77550[/import]