Hi
Anybody can help me ? :) I want to retrieve the event mousedown or mousemove with Canvas+ B3DSdk ? Uncomment the lines to see the problem in action. When B3D is not assigned to the canvas the events are ok.
Anybody can help me ? :) I want to retrieve the event mousedown or mousemove with Canvas+ B3DSdk ? Uncomment the lines to see the problem in action. When B3D is not assigned to the canvas the events are ok.
Import blitz3d.blitz3dsdk Import BRL.MaxGUI MYwindow:TGadget=CreateWindow("Hell!",0,0,640,480,0,1) W = ClientWidth(Desktop()) H = ClientHeight(Desktop() ) MYcanvas:TGadget = CreateCanvas(10, 10 ,520 , 400 , MYwindow) ' ------------------------ ' Uncomment to see the bug ' ------------------------ 'bbSetBlitz3DHWND(QueryGadget(MYcanvas,QUERY_HWND)) 'bbBeginBlitz3D() 'bbGraphics3D W , H , 0 , 2 'EnablePolledinput() Global mx:Int , my:Int Repeat WaitEvent() Select EventID() Case EVENT_WINDOWCLOSE DebugLog "CLOSING WINDOW" End Case EVENT_MOUSEMove Select EventSource() Case MYCANVAS DebugLog EventX() + " " + EventY() mx = EventX() my = EventY() drag = 1 Print "HIT ME : "+MilliSecs() End Select Case event_mouseup drag=0 Case EVENT_GADGETPAINT SetGraphics CanvasGraphics (MyCanvas) DrawRect 20,20,50,80 Flip Case event_mousemove If drag DebugLog "canvs : " + GadgetX(mycanvas) + " " + GadgetY(mycanvas) DebugLog "window : " + GadgetX(mywindow) + " " + GadgetY(mywindow) DebugLog MouseX() + " " + MouseY() x = EventX() + GadgetX(mycanvas) - mx y = EventY() + GadgetY(mycanvas) - my SetGadgetShape (mycanvas, x,y,GadgetWidth(mycanvas),GadgetHeight(mycanvas)) EndIf End Select Forever End