MeBoingus
Member
Hi all,
I'm a bit stumped on this one at the moment. I'm trying to set up a system where a sprite can be rotated as if it had a specific x and y offset, without the sprite actually having the offset.
Here's why:
Does anyone know of a way to rotate the sprite as if it had a specific set of origin points?
For example, let's say we have a 100x100 sprite, with the origin point set to 0, 0. Is there any way to rotate that sprite as if the origin point were set to 50, 50?
Thanks kindly for your help .
I'm a bit stumped on this one at the moment. I'm trying to set up a system where a sprite can be rotated as if it had a specific x and y offset, without the sprite actually having the offset.
Here's why:
I've written a bit of code that allows the user to drag the mouse around in order to scale a sprite. The drawing code I'm using is as follows:
Pretty simple stuff. I'm changing the X and Y scale to the 'w' and 'h' variables (the users selected width and height) and then dividing that by the sprite's original width/height.
The problem arises when the sprite has an offset. The sprite is scaled based on that offset. In other words, if I want to scale a sprite so that it's stretched to the right-hand side, or the left-hand side, the offset causes the sprite to be scale in either direction.
Code:
draw_sprite_ext(spr, 0, x, y, w / sprite_get_width(spr), h / sprite_get_height(spr), ang, c_white, opc);
The problem arises when the sprite has an offset. The sprite is scaled based on that offset. In other words, if I want to scale a sprite so that it's stretched to the right-hand side, or the left-hand side, the offset causes the sprite to be scale in either direction.
Does anyone know of a way to rotate the sprite as if it had a specific set of origin points?
For example, let's say we have a 100x100 sprite, with the origin point set to 0, 0. Is there any way to rotate that sprite as if the origin point were set to 50, 50?
Thanks kindly for your help .