Not sure if I have misunderstood how it works, but I can't get SetHandle to work.
I have two images - a tank body, and a turret. Both images are 60 x 60 with the image handle set to the middle of each image. The turret is drawn over the main tank body. No probs that all works fine.
However, when I rotate the turret it is obviously rotating from the centre, so I have tried using SetHandle to offset where it rotates from. No matter what values I use in Sethandle it always rotates from the centre of the image.
The folowing code is an extract from my main loop:
The manual does say that SetHandle subtracts BEFORE rotation are done, so why doesn't this work?
I have two images - a tank body, and a turret. Both images are 60 x 60 with the image handle set to the middle of each image. The turret is drawn over the main tank body. No probs that all works fine.
However, when I rotate the turret it is obviously rotating from the centre, so I have tried using SetHandle to offset where it rotates from. No matter what values I use in Sethandle it always rotates from the centre of the image.
The folowing code is an extract from my main loop:
DrawImage tankImg, x, y If KeyDown(Key_Z) Then rotation# = rotation# - 1 If KeyDown(Key_X) Then rotation# = rotation# + 1 SetHandle 15, 0 '<- no worky SetRotation rotation# DrawImage turretImg, x, y SetRotation 0
The manual does say that SetHandle subtracts BEFORE rotation are done, so why doesn't this work?