• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GameMaker Spine scaling issue

Jeremy

Member
How it looks in spine:

I then draw it in the game using:
Code:
draw_skeleton(sprite_index, "Idle 1", "Skin", image_index, x, y, 1, 1, 0, c_white, 1);
it looks like this:


But if I try to draw it at ANY other scale, bigger or smaller, it gets wierd.
Here it's drawn using this:
Code:
draw_skeleton(sprite_index, "Idle 1", "Skin", image_index, x, y, 0.5, 0.5, 0, c_white, 1);


All help is greatly appreciated!
 
R

Radek

Guest
Hi, sorry for resurrecting this, but maybe someone will search as I do.

Just found out that the parts that are not scaling right have their "scale" inherit turned off in Spine. So it seems like GMS2 is scaling only the bones that inherit its scale.

Don't have a solution yet apart from keeping the scale inherit "checked" for all bones.
 

TailBit

Member
Could you try and see if the script found here works:
How to scale sprite assets

Instead of draw_self there, then you might want to use draw_skeleton with no scaling at (0,0) ..

I still got yet to use Spine in GM, but I did notice this problem in the short test I did :/ .. maybe it deserves a bug report?
 

FoxyOfJungle

Kazan Games
Could you try and see if the script found here works:
How to scale sprite assets

Instead of draw_self there, then you might want to use draw_skeleton with no scaling at (0,0) ..

I still got yet to use Spine in GM, but I did notice this problem in the short test I did :/ .. maybe it deserves a bug report?
This method uses deprecated functions like d3d_, maybe I think it would be possible to do this using a matrix transformation:

GML:
var _cur_matrix_world = matrix_get(matrix_world);
matrix_set(matrix_world, matrix_build(x, y, 0, 0, 0, 0, scale_x, scale_y, 1));
// draw spine sprite here pos(0, 0)
matrix_set(matrix_world, _cur_matrix_world);

I recommend this video:

 
Last edited:

Nocturne

Friendly Tyrant
Forum Staff
Admin
Ok I have the same problem. Has anyone solved this? ๐Ÿ˜‚๐Ÿ˜‚๐Ÿ˜‚
That's a nightmare fuel image!!!

Anyway, the person that last posted about this said that:
GMS2 is scaling only the bones that inherit its scale.
Don't have a solution yet apart from keeping the scale inherit "checked" for all bones.
Have you tried that? Does it resolve the issue? Even if it does, I'd still file a bug (and include a YYZ of the project showing the issue) and request that either: the manual gets updated to say this is a requirement, or the Spine functions get "fixed" to make so that inheritance isn't required (I suspect that this will not be possible though, so the docs will simply be updated). Either way, YYG should know about the issue.
 
๐Ÿ‘ฝ First of all, I would like to say a few words to everyone who responded. I have been reading this forum for several years, but never once tried to ask anything myself. Finally, yesterday I signed up, asked a question and got some quick answers. It was unexpected and pleasant. Thank you all very much!

About the problem. I did some experiments and here's what I got.

Case 1

You can actually try to fix the problem by following the instructions in this post:


Hi, sorry for resurrecting this, but maybe someone will search as I do.

Just found out that the parts that are not scaling right have their "scale" inherit turned off in Spine. So it seems like GMS2 is scaling only the bones that inherit its scale.

Don't have a solution yet apart from keeping the scale inherit "checked" for all bones.
This is not always possible, as if the animation is too complex it will be extremely difficult task for your animator. In my example, the animator managed to fix everything except the eyes. When he got to this part, he said that if I didn't find how to fix it differently, he would find a place for me in hell. ))

yoyo1.png


Case 2

This is a case about an old script that uses deprecated functions:

Could you try and see if the script found here works:
How to scale sprite assets

Instead of draw_self there, then you might want to use draw_skeleton with no scaling at (0,0) ..

I still got yet to use Spine in GM, but I did notice this problem in the short test I did :/ .. maybe it deserves a bug report?
I've seen this script before, but as @FoxyOfJungle said, the script uses deprecated functions. However, he proposed an unexpected and extremely elegant solution using matrix transformation:

GML:
var _cur_matrix_world = matrix_get(matrix_world);
matrix_set(matrix_world, matrix_build(x, y, 0, 0, 0, 0, scale_x, scale_y, 1));
// draw spine sprite here pos(0, 0)
matrix_set(matrix_world, _cur_matrix_world);
AND IT WORKS! Anyway, for desktop and android.

๐Ÿค— Thanks again to everyone who responded. A very warm and responsive community. The problem is solved.
 

Jeremy

Member
Oh wow, this is a blast from the past for me!
Glad to see a fix was found!

I remember 'fixing' it by writing a script outside of gamemaker that would loop through the spine .json file setting "inheritScale":true everywhere.
Can't seem to find it tough - it's been years since I've used spine in any of my projects anymore.
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
This is not always possible, as if the animation is too complex it will be extremely difficult task for your animator. In my example, the animator managed to fix everything except the eyes. When he got to this part, he said that if I didn't find how to fix it differently, he would find a place for me in hell. ))
Sorry, but I laughed really hard at both this and the image! Brilliant...

But the issue is indeed a real one and no laughing matter so PLEASE make a YYZ of the project and file a bug report with YYG even though a workaround has been found. It may be a bug, it may not be but is still something they can fix, or it may be that it simply needs documenting as "something to be aware of".
 
Top