This is a new post, but wanted to save space, SSH's reply was to my old issue which is now fixed.
Original issue had DynamicSprite* sprite within the function rather than being global so was being lost immediately after calling.
I am trying to improve my game by replacing the RawDrawLine I have with an object as the line needs to be intractable. I'm trying to use a DynamicSprite to stretch and skew the image and assign that new sprite to the object of my choosing.
I'm messing around in a test ags document using the default template at the moment and this is what I have.
Code: ags
The problem I'm having is getting the line to rotate properly through the angles like a clock hand going clockwise. I want the starting point (which is in the top right hand of the screen) to remain the same and the hand to rotate around that central point. It manages fine for the first 90 degrees but then starts bugging out. I'm pretty sure it's to do with the objects co-ordinates being the bottom left most pixel of the object which doesn't change, but the objects size is changing as the image rotates.
I could really use some further help here.
Cheers guys n gals,
Maggi
Original issue had DynamicSprite* sprite within the function rather than being global so was being lost immediately after calling.
I am trying to improve my game by replacing the RawDrawLine I have with an object as the line needs to be intractable. I'm trying to use a DynamicSprite to stretch and skew the image and assign that new sprite to the object of my choosing.
I'm messing around in a test ags document using the default template at the moment and this is what I have.
DynamicSprite* sprite;
while(count < 359)
{
Wait(8);
sprite = DynamicSprite.CreateFromExistingSprite(6);
sprite.Resize(2, 350); // This makes the single red dot a thin line
sprite.Rotate(1+count); // Incrementally rotate
object[0].Graphic = sprite.Graphic;
count+=2;
}
The problem I'm having is getting the line to rotate properly through the angles like a clock hand going clockwise. I want the starting point (which is in the top right hand of the screen) to remain the same and the hand to rotate around that central point. It manages fine for the first 90 degrees but then starts bugging out. I'm pretty sure it's to do with the objects co-ordinates being the bottom left most pixel of the object which doesn't change, but the objects size is changing as the image rotates.
I could really use some further help here.
Cheers guys n gals,
Maggi