Getting X,Y back from a sprite (delphiX)

Started by
1 comment, last by czar 22 years, 6 months ago
Hello, I have the following problem. I have a sprite, TShipBase = Class (TImageSprite) // snip // end; TForm1 = class(TForm) // snip // private BaseShip : TShipBase; public end; Then further down I want to find out where the sprite currently is. In the create section I set the X and Y with TShipBase.Create(DXSpriteEngine1.Engine) do begin Image := DXImageList1.Items[BASE_PIC]; x := 480; y := 120; // snip // end; So far no problem, but when I try to ask for the X and the Y coords the program crashes e.g. SpriteCoordX := baseship.x; The program compiles but it crashes when run. Can anyone point out my error? Ralph
Advertisement

baseShip := TShipBase.create(..);
with baseship do begin;
//snip
end;
Yes, That did the trick. Now I can get on with my work.

This topic is closed to new replies.

Advertisement