• Hey! Guest! The 40th (!!!) GMC Jam will take place between February 25th, 12:00 UTC to March 1st 12:00 UTC. Why not join in this very special anniversary jam! Click here to find out more!

costum offset based on image_xscale

jonjons

Member
hello
Is there a formula do to this ?
i have this surface with its offset:
GML:
surfAnim = surface_create(180, 140);
AnimXoffset = 88;
AnimYoffset = 128;
iam using it on the object origin x and y to replace the sprite.
Code:
draw_surface_ext(surfAnim, x - AnimXoffset , y - AnimYoffset...... ...
problem is the image scale... If i set the scale to 0.5, 0.5.
i need to devide the AnimXoffset /2 and the AnimYoffset /2 ( to keep it on the object center origin )

but i cant do this ....
GML:
surfAnim = surface_create(180, 140);
AnimXoffset = 88/image_xscale;
AnimYoffset = 128/image_yscale;
is there a formula to tweak the costum AnimXoffset and the AnimYoffset based on the image scale ?
 
Top