Hi there,
ok I've played a bit. Working landscape as my example above works fine but for portrait the same(!) code fails, is there a bug?
Landscape working example:
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "agktest" )
SetWindowSize( 640, 360, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
CreateSprite ( 1, LoadImage ( "background.png" ) )
// set display properties
SetVirtualResolution( 480, 360 ) // doesn't have to match the window
SetOrientationAllowed( 0, 0, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 30, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
do
SetSpritePosition( 1, GetScreenBoundsLeft(), 0 )
Sync()
loop
Portrait NOT working example:
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "agktest" )
SetWindowSize( 360, 640, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
CreateSprite ( 1, LoadImage ( "background2.png" ) )
// set display properties
SetVirtualResolution( 360, 480 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 0, 0 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 30, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
do
SetSpritePosition( 1, 0, GetScreenBoundsTop() )
Sync()
loop
I'm totally lost now. I mean the second example is exactly the same like for landscape but the floating layout simply doesn't work the same way!
When you look at the attached image you see that square. For portrait mode this is stretched even though this should not happen!
edit: I see that's the case for landscape too... Well back to drawing board.
Another question: When using a virtual resolution of 100x100 doesn't this mean that everything is pretty blurred when it comes to sprites?