the $FF000000 represents an AARRGGBB integer, the $FF portion being full opacity, doing a bitwise AND between it and the pixel we are checking will return a boolean true when the pixel has full opacity
Technically, that line could be changed to:
in fact a further optimisation could be:
And if further optimised could be something like:
I'm not sure I'm explaining it as well as I could, my brain understands it better than I do.
Technically, that line could be changed to:
Return pix & $FF000000
in fact a further optimisation could be:
Method HitTest:Int(hitX:Float, hitY:Float) Return ReadPixel(_pixmap, hitX, hitY) & $FF000000 End Method
And if further optimised could be something like:
If ReadPixel(_pixmap, MouseX()-X, MouseY()-Y) & $FF000000 Then If (onClick <> Null) Then onClick() EndIf EndIf
I'm not sure I'm explaining it as well as I could, my brain understands it better than I do.