Help! Mouse control outside of canvas..

BlitzPlus Forums/BlitzPlus Programming/Help! Mouse control outside of canvas..

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.

norki: Uhm, uh, is this what you want to establish?
(hold down the mousebutton and drag the mouse in the canvas)
app=CreateWindow("bla",0,0,640,480)

canvas=CreateCanvas(32,32,128,128,app)


Repeat
	WaitEvent()
	If EventID()=$803 quit=True

	If EventSource()=canvas
		If EventID()=$201
			lmd=True
		EndIf
		If EventID()=$202
			lmd=True
		EndIf
		If lmd
			SetBuffer CanvasBuffer(canvas)
				x=EventX()
				y=EventY()
				cx=x
				cy=y

				If cx<0 cx=0
				If cy<0 cy=0
				If cx>127 cx=127
				If cy>127 cy=127

				Cls
				
				Color 255,255,255
				Rect cx-4,cy-4,9,9,False

				Text 32,32,"x: "+x
				Text 32,48,"y: "+y

				
			FlipCanvas canvas
		EndIf
	EndIf
	
Until quit
End