Hi everybody!
I was sure that SetSpritePosition (SpriteNumber, 0, 0) should put my sprite in top left corner of the app's window no matter what.
But it looks like it's true only when the screen size's aspect is 4:3 (e/g 1024 / 768).
It other cases the sprite is moved some distance towards the center along X axis.
Here are some code examples and screens:
With 4:3 screen
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "Test" )
//SetWindowSize( 1920, 1080, 0 )
SetWindowSize( 2000, 1500, 0 )
SetClearColor (200, 145, 7)
// set display properties
SetOrientationAllowed( 1, 1, 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
// Show Sprite
PlaneImage as integer
PlaneSprite as integer
PlaneImage = LoadImage ("Plane.png")
PlaneSprite = CreateSprite (PlaneImage)
SetSpriteSize (PlaneSprite, 10, -1)
SetSpritePosition (PlaneSprite, 0, 0)
https://imgur.com/a/RXW64Yr
With some other aspect
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "Test" )
SetWindowSize( 1920, 1080, 0 )
//SetWindowSize( 2000, 1500, 0 )
SetClearColor (200, 145, 7)
// set display properties
SetOrientationAllowed( 1, 1, 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
// Show Sprite
PlaneImage as integer
PlaneSprite as integer
PlaneImage = LoadImage ("Plane.png")
PlaneSprite = CreateSprite (PlaneImage)
SetSpriteSize (PlaneSprite, 10, -1)
SetSpritePosition (PlaneSprite, 0, 0)
https://imgur.com/a/GWYzvl0
So am I doing something wrong? Or do o,o coordinates not always mean the top left corner in percentage system?