Page 1 of 1

PtInRect_ Help Please

Posted: Tue Aug 09, 2011 12:16 pm
by SoulReaper
Hello all :)

I have not been on the forums for some time but im still here :)

I am trying to convert this Routine to PureBasic 4.51 but it says Incorrect number of parameters.

Code: Select all

Procedure InsideGadget(g.l)
; True when mouse x & mouse y are inside Gadget else Returns False 
  GetWindowRect_(GadgetID(g),@rec.RECT) 
  If PtInRect_(@rec,DesktopMouseX(),DesktopMouseY()) 
    ProcedureReturn #True 
  Else 
    ProcedureReturn #False 
  EndIf 
EndProcedure
How would it be done in PureBasic 4.51 as it works in 4.20

Thankyou in Advance
Kevin :wink:

Re: PtInRect_ Help Please

Posted: Tue Aug 09, 2011 12:18 pm
by flaith
Hi,

try instead

Code: Select all

PtInRect_(moverect, DesktopMouseX() | (DesktopMouseY()<<32))
:mrgreen:

Re: PtInRect_ Help Please

Posted: Tue Aug 09, 2011 12:47 pm
by SoulReaper
Thankyou :)

I would never have thought of doing it that way :lol:

Regards
Kevin