I followed your tip, but it didn't change the results.
I noticed that if I 'comment out' all instances that reference the 'square' image or sprite, the 'star' sprite behaves as expected.
This is really confusing...
// Project: test
// Created: 20-04-18
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "test" )
SetWindowSize( 600, 400, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 600, 400 ) // doesn't have to match the window
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 )
//-------------------------------------------------------------------------------------------
Image_Star As Integer
Image_Square As Integer
Sprite_Star As Integer
Sprite_Square As Integer
Image_Star = LoadImage( "star_sprite.png" , 0 )
`Image_Square = LoadImage( "2xblue.png" , 0 )
Sprite_Star = CreateSprite( LoadImage( "star_sprite.png" ) )
//comment this
`Sprite_Square = CreateSprite( Image_Square )
//and uncomment this to see that the "Sprite_Star" looks correct
`Sprite_Square = CreateSprite( 0 )
SetSpriteSize( Sprite_Star , 64.0 , 64.0 )
`SetSpriteSize( Sprite_Square , 20.0 , 20.0 )
SetSpritePosition( Sprite_Star, 250 , 250 )
`SetSpritePosition( Sprite_Square, 0 , 100 )
//-------------------------------------------------------------------------------------------
do
If GetRawKeyReleased(27)=1
End
Endif
Print( GetPointerX() )
Print( GetPointerY() )
Print( ScreenFPS() )
Sync()
loop
... and when I simply switch the order at which the two sprites are created, I get different (undesirable) behavior...
// Project: test
// Created: 20-04-18
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "test" )
SetWindowSize( 600, 400, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 600, 400 ) // doesn't have to match the window
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 )
//-------------------------------------------------------------------------------------------
Image_Star As Integer
Image_Square As Integer
Sprite_Star As Integer
Sprite_Square As Integer
Image_Star = LoadImage( "star_sprite.png" , 0 )
Image_Square = LoadImage( "2xblue.png" , 0 )
Sprite_Square = CreateSprite( Image_Square )
Sprite_Star = CreateSprite( Image_Star )
SetSpriteSize( Sprite_Star , 64.0 , 64.0 )
SetSpriteSize( Sprite_Square , 20.0 , 20.0 )
SetSpritePosition( Sprite_Star, 250 , 250 )
SetSpritePosition( Sprite_Square, 0 , 100 )
//-------------------------------------------------------------------------------------------
do
If GetRawKeyReleased(27)=1
End
Endif
Print( GetPointerX() )
Print( GetPointerY() )
Print( ScreenFPS() )
Sync()
loop
... Not even hard coding the image/sprite ID's is fixing the issue
// Project: test
// Created: 20-04-18
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "test" )
SetWindowSize( 600, 400, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 600, 400 ) // doesn't have to match the window
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 )
//-------------------------------------------------------------------------------------------
LoadImage( 1 , "star_sprite.png" )
LoadImage( 2 , "2xblue.png" )
CreateSprite( 1 , 1 )
CreateSprite( 2 , 2 )
SetSpriteSize( 1 , 64.0 , 64.0 )
SetSpriteSize( 2 , 20.0 , 20.0 )
SetSpritePosition( 1 , 250 , 250 )
SetSpritePosition( 2 , 0 , 100 )
//-------------------------------------------------------------------------------------------
do
If GetRawKeyReleased(27)=1
End
Endif
Print( GetPointerX() )
Print( GetPointerY() )
Print( ScreenFPS() )
Sync()
loop
|,,|, ,|,,|