| View previous topic :: View next topic |
| Author |
Message |
Snootae Grandmaster Cheater
Reputation: 0
Joined: 16 Dec 2006 Posts: 969 Location: --->
|
Posted: Mon Jan 21, 2008 7:15 am Post subject: Delphi Point Setting |
|
|
I was just wondering how you can set a TPoint's X and Y
and also, how can you check the position, against say an ImageBox
like if | Code: | | Image1.Left := Point.X then |
but that doesn't work because it needs to be a boolean
any ideas?
Last edited by Snootae on Mon Jan 21, 2008 7:21 am; edited 3 times in total |
|
| Back to top |
|
 |
Reak I post too much
Reputation: 0
Joined: 15 May 2007 Posts: 3496
|
Posted: Mon Jan 21, 2008 7:20 am Post subject: |
|
|
Edit:
Ohh, just noticed your edit.
You could just use Integers.
| Code: | procedure TForm1.Button1Click(Sender: TObject);
var
X, y: Integer;
begin
x := 100;
y := 200;
Image1.Top := y;
Image1.Top := x;
end; |
Edit2:
I just tried it out with TPoint, worked for me:
| Code: | procedure TForm1.Button1Click(Sender: TObject);
var
Point: Tpoint;
begin
Point.X := 100;
Point.Y := 200;
Image1.Top := Point.X;
Image1.Top := Point.Y;
end; |
|
|
| Back to top |
|
 |
Snootae Grandmaster Cheater
Reputation: 0
Joined: 16 Dec 2006 Posts: 969 Location: --->
|
Posted: Mon Jan 21, 2008 7:49 am Post subject: |
|
|
| thanks, any idea about the ifing?
|
|
| Back to top |
|
 |
Symbol I'm a spammer
Reputation: 0
Joined: 18 Apr 2007 Posts: 5094 Location: Israel.
|
Posted: Mon Jan 21, 2008 7:59 am Post subject: |
|
|
well, first of all, to use "if" statment you need to use "if"
if Image1.Left = Position.X then ShowMessage('Oh noez');
in delphi, when using if, there's no ":", because := is for assignment and = is for comparing.
|
|
| Back to top |
|
 |
Snootae Grandmaster Cheater
Reputation: 0
Joined: 16 Dec 2006 Posts: 969 Location: --->
|
Posted: Mon Jan 21, 2008 8:58 am Post subject: |
|
|
ahh, just what i was looking for
GO Symbol!
|
|
| Back to top |
|
 |
|