I have done this before on programs I made before, but this time I cannot detect accurately the sprites on the screen with my mouse pointer.
Am I supposed to use 'World Mode' ? I don't know how to fix it. My mouse pointer is out of sync with my screen.
I did re-scale the sprites to 50% of their initial size, could that be why?
screen setup:
// Created: 2018-01-21
// show all errors
SetErrorMode(2)
// set window properties
SetWindowSize( 1366, 768, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 1366, 768 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 60, 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
SetClearColor(49,185,200)
mouse pointer detection portion:
operate_mouse:
if firstime1 = 0
LoadImage(300,'mouse_pointer.png')
SetImageTransparentColor( 300, 0, 0, 0 ) `black transparent
CreateSprite(300,300)
`SetSpriteTransparency(300,1)
firstime1 = 1
endif
if getpointerpressed()=1
SetSpritePosition(300,GetPointerX(),GetPointerY())
x = GetPointerX() : y = GetPointerY()
s as integer
for s = 1 to total
if GetSpriteCollision( 300, s) = 1
PrintC ("s =")
printC(s)
`exit
endif
next s
endif
return