Hi I have this function, whose purpose is to draw a button on screen and set its three possible ways, when idle, when the mouse hovers over it and when it is pressed.
I need to know is how to improve this function to set and what all the buttons are pressed and trigger their respective event.
Function Click_Boton(Boton1%=0,Boton2%=0,Boton3%=0,PX#,PY#)
Local MX = MouseX()
Local MY = MouseY()
StartDraw
If TestImage(MX,MY,PX,PY,Boton1,255) = False
DrawImageEx(Boton1,PX,PY)
ElseIf TestImage(MX,MY,PX,PY,Boton1,255) = True
DrawImageEx(Boton2,PX,PY)
If MouseDown(1)
DrawImageEx(Boton3,PX,PY)
End If
End If
SetScale (.5,.5)
DrawImageEx(Puntero,MX,MY)
SetScale (1,1)
EndDraw
End Function
|