Log in

View Full Version : Function that turns a TPoint into x and y integers



Footy
08-14-2012, 03:32 PM
Im looking for a function that does that, because AFAIK, I cant use a Tpoint in Mouse(x, y, rx, ry, button). Searching in the functionlist, I came up with nothing...

eska
08-14-2012, 03:37 PM
You can access the x and y inside the point.

Say your point is called myPoint, you can get the x inside it like this:
myPoint.X

So, for your mouse you could do this:
Mouse(myPoint.X, myPoint.Y, rx, ry, button)

VastlySuperior
08-14-2012, 03:38 PM
Tpoint.x,TPoint.y

There ya go

Footy
08-14-2012, 03:38 PM
Thanks guys! Forgot I could do that!

m3gaman3g3nd
08-14-2012, 11:45 PM
yeh u can use tpoint in mouse lol haha yeah juss gotta declare ....


point=point.x and point.y

Richard
08-15-2012, 12:04 AM
If you want a procedure that means you can store the values if you wish to use them at a later point:


procedure TPointToXY(TP: TPoint; var x,y: integer);
begin
x := TP.x;
y := TP.y;
end;