ImageClicked

Blitz3D Forums/Blitz3D Programming/ImageClicked

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Try the following:

Global left_click
Global right_click

; Add the following lines in your main loop
left_click = MouseHit(1)
right_click = MouseHit(2)

Function LeftClicked( image.tyitem )
	If not left_click Then Return False
	img = CreateImage(1,1)
	If ImagesOverlap(img, MouseX(), MouseY(), image\hndIconImage, image\x, image\y)
		FreeImage img
		Return True
	EndIf
End Function

Function RightClicked( image.tyitem )
	If not right_click Then Return False
	img = CreateImage(1,1)
	If ImagesOverlap(img, MouseX(), MouseY(), image\hndIconImage, image\x, image\y)
		FreeImage img
		Return True
	EndIf
End Function