In my app, a game, when the hero character is killed, I want to scroll the back to the starting position. What happens is that it jumps back.
I use a loop, but it seems that the GameView does not update until the loop finishes.
Any idea what I might be doing wrong?
I use a loop, but it seems that the GameView does not update until the loop finishes.
Any idea what I might be doing wrong?
B4X:
Log("startLocY: " & startLocY)
Log("CenterY: " & game.streetBackground.SrcRect.CenterY)
Do While game.streetBackground.SrcRect.CenterY <> startLocY
If game.streetBackground.SrcRect.CenterY > startLocY Then
game.streetBackground.SrcRect.top = game.streetBackground.SrcRect.top - 1 '4dip ' Mod (game.streetBackground.Bitmap.Height - 62%y / game.backgroundScale)
game.streetBackground.SrcRect.Bottom = game.streetBackground.SrcRect.top + 62%y / game.backgroundScale + 1
Else
game.streetBackground.SrcRect.top = game.streetBackground.SrcRect.top + 1 '4dip ' Mod (game.streetBackground.Bitmap.Height - 62%y / game.backgroundScale)
game.streetBackground.SrcRect.Bottom = game.streetBackground.SrcRect.top + 62%y / game.backgroundScale + 1
End If
pauseInterval = pauseInterval + 1
Log("scrY" & game.streetBackground.SrcRect.CenterY )
game.gv.Invalidate