At the moment i'm working on a BlackJack Card game, that has several buttons you can click on in order to act upon the situation you're in.
The problem is that whenever i click in a region outside the buttons, there is a mouseclick in the queue, and then when i move over a button the code in the "If ImagesOverlap()" statement is executed.
At the moment i can sort of handle this problem by using FlushMouse every second, but do you guys know a better way to solve this problem?
This is what i use:
and this is what i do every frame to clear the Mousehit queue:
I hope you guys know a better way...:)
The problem is that whenever i click in a region outside the buttons, there is a mouseclick in the queue, and then when i move over a button the code in the "If ImagesOverlap()" statement is executed.
At the moment i can sort of handle this problem by using FlushMouse every second, but do you guys know a better way to solve this problem?
This is what i use:
If ImagesOverlap(btn,100-15,GraphicsHeight()-(ImageHeight(btn)*2)+10,pointer,MouseX(),MouseY()) DrawImage btn_o,100-15,GraphicsHeight()-(ImageHeight(btn)*2)+10 If MouseHit(1) PlaySound clicksnd ;rest of the code EndIf Else DrawImage btn,100-15,GraphicsHeight()-(ImageHeight(btn)*2)+10 EndIf
and this is what i do every frame to clear the Mousehit queue:
If MilliSecs() > timer+1000 timer=MilliSecs() FlushMouse EndIf
I hope you guys know a better way...:)