Legacy GM How to scale spine assets?

A

AvenNigera

Guest
Hi Guys,

I wanted to learn working with spine assets and bought one from the marketplace. They are working fine so far but they are to big. So I tried to use image_xscale = .1; and image_yscale = .1; but nothing happened.

Can anyone tell me how it works to scale these assets? :(

Thank you!
 

HammerOn

Member
There are many ways to scale in GMS.
Most of the time, image_xscale and image_yscale alone don't work. Spine animations are complex and some have bones that don't inherit scale (and rotation).
You can create a skeleton_draw script and call it in the Draw Event of the object:

Code:
// skeleton_draw(x, y, xscale, yscale)

var xTemp = argument0;
var yTemp = argument1;
var tempXscale = argument2;
var tempYscale = argument3;

// Reset built-in variables
image_xscale = 1;
image_yscale = 1;
x = 0;
y = 0;

// Transform
d3d_transform_add_scaling(tempXscale, tempYscale, 1);
d3d_transform_add_translation(xTemp, yTemp, 0);

// Draw
draw_self();

// Reset transformation
d3d_transform_set_identity();

// Return built-in variables to previous values
x = xTemp;
y = yTemp;
image_xscale = tempXscale;
image_yscale = tempYscale;
 
Last edited:
A

AvenNigera

Guest
Hey Christian,

very nice that you answered my question. Thanks for your awesome help! I will try it out :)

EDIT: It works! Thank you so much!
 
Last edited by a moderator:
Top