Hello,
i am facing problem in understanding the working of the Orientation function especially the highlighted line. its coding of Sample project “Fishies”.
Here’s the function .
local backgroundOrientation = function( event )
– TODO: This requires some setup, i.e. the landscape needs to be centered
– Need to add a centering operation. For now, the position is hard coded
local delta = event.delta
if ( delta ~= 0 ) then
local rotateParams = { rotation=-delta, time=1000, delta=true }
if ( delta == 90 or delta == -90 ) then
local src = background
– toggle background to refer to correct dst
background = ( backgroundLandscape == background and backgroundPortrait ) or backgroundLandscape
background.rotation = src.rotation
transition.dissolve( src, background )
transition.to( src, rotateParams )
else
assert( 180 == delta or -180 == delta )
end
transition.to( background, rotateParams )
audio.play( soundID ) – play preloaded sound file
end
end