Okay so I've got some sprites.. I'm using GetSpriteHit to check for if a certain sprite has been pressed, and then returning a value based on the sprite.
Code looks like this for the check:
if GetPointerPressed() = 1
buttonID = GetSpriteHit ( ScreenToWorldX(GetPointerX()), ScreenToWorldY(GetPointerY()) )
endif
if buttonID = 1
performAfunction()
endif
It will work most of the time, but sometimes when I press around on the buttons, nothing happens and I have to click a few times for it to do the check correctly. I've tried using GetSpriteHitTest() and it does the same thing. Behind these buttons I have a background sprite, but I don't think that is causing the issue. But maybe? I've also used SetSpriteShape to ensure they're all boxes, but nothing makes a different.. tried commenting out SetWindowSize/SetDisplayAspect/FixSpriteToScreen all sorts of things all still end with the same result. Help please!