PtInRect_ Help Please

Just starting out? Need help? Post your questions and find answers here.
SoulReaper
Enthusiast
Enthusiast
Posts: 372
Joined: Sun Apr 03, 2005 2:14 am
Location: England

PtInRect_ Help Please

Post 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:
User avatar
flaith
Enthusiast
Enthusiast
Posts: 704
Joined: Mon Apr 25, 2005 9:28 pm
Location: $300:20 58 FC 60 - Rennes
Contact:

Re: PtInRect_ Help Please

Post by flaith »

Hi,

try instead

Code: Select all

PtInRect_(moverect, DesktopMouseX() | (DesktopMouseY()<<32))
:mrgreen:
“Fear is a reaction. Courage is a decision.” - WC
SoulReaper
Enthusiast
Enthusiast
Posts: 372
Joined: Sun Apr 03, 2005 2:14 am
Location: England

Re: PtInRect_ Help Please

Post by SoulReaper »

Thankyou :)

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

Regards
Kevin
Post Reply