' createcanvas.bmx Strict Global GAME_WIDTH=320 Global GAME_HEIGHT=240 ' create a centered window with client size GAME_WIDTH,GAME_HEIGHT Local wx=(ClientWidth(Desktop())-GAME_WIDTH)/2 Local wy=(ClientHeight(Desktop())-GAME_HEIGHT)/2 Local window:TGadget=CreateWindow("My Canvas",wx,wy,GAME_WIDTH,GAME_HEIGHT,Null,WINDOW_TITLEBAR|WINDOW_CLIENTCOORDS) ' create a canvas for our game Local canvas:TGadget=CreateCanvas(0,0,320,240,window) ' create an update timer CreateTimer 60 Local MX:Int = 0 'MouseX() Local MY:Int = 0 'MouseY() Local MB:Int = 0 'MouseButton() While WaitEvent() Select EventID() Case EVENT_TIMERTICK RedrawGadget canvas Case EVENT_GADGETPAINT SetGraphics CanvasGraphics(canvas) SetOrigin 160,120 SetLineWidth 5 Cls DrawText MX +","+ MY + " --> " + MB, 10,10 Local t=MilliSecs() DrawLine 0,0,120*Cos(t),120*Sin(t) DrawLine 0,0,80*Cos(t/60),80*Sin(t/60) Flip 'MouseEvents Case EVENT_MOUSEMOVE MX = EventX() MY = EventY() Case EVENT_MOUSEDOWN MB = EventData() Case EVENT_MOUSEUP MB = 0 Case EVENT_WINDOWCLOSE FreeGadget canvas End Case EVENT_APPTERMINATE End End Select Wend
Help!! Where are the mouseEvents?
BlitzMax Forums/BlitzMax Beginners Area/Help!! Where are the mouseEvents?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.