handle e.g. 320x240 backgrounds in scale_or_crop_backgrounds()

This commit is contained in:
AJ Kelly
2012-01-06 02:01:28 -06:00
parent 40779f4daa
commit d9d45c4557
+6 -1
View File
@@ -168,7 +168,12 @@ function Actor:scale_or_crop_background()
-- bga matches the current aspect, we can stretch it.
self:stretchto( 0,0,SCREEN_WIDTH,SCREEN_HEIGHT )
else
self:scaletofit( SCREEN_CENTER_X-(gw/2),SCREEN_TOP,SCREEN_CENTER_X+(gw/2),SCREEN_HEIGHT)
if gh < DISPLAY:GetDisplayHeight() then
-- we have a bg smaller than the display height. we need to scale it up.
self:scaletofit( SCREEN_CENTER_X-((graphicAspect*SCREEN_HEIGHT)/2),SCREEN_TOP,SCREEN_CENTER_X+((graphicAspect*SCREEN_HEIGHT)/2),SCREEN_HEIGHT)
else
self:scaletofit( SCREEN_CENTER_X-(gw/2),SCREEN_TOP,SCREEN_CENTER_X+(gw/2),SCREEN_HEIGHT)
end
end
end