YoYoGames / GameMaker-Bugs

Public tracking for GameMaker bugs
21 stars 8 forks source link

The ability to draw other game objects or sprites between different parts of a Spine animation. #3010

Open SimpCarlWheezer opened 1 year ago

SimpCarlWheezer commented 1 year ago

Is your feature request related to a problem?

Currently, it is not possible to draw other game objects or sprites between the different parts of a character designed in Spine.

skeleton-render-separator-spineboy

Describe the solution you'd like

A system that can display different parts of the Spine animation in different layers / depths would be the solution.

Describe alternatives you've considered

The temporary solution I found requires a separate animation design for specific interactions with the environment and other characters. I think it may be possible to customize the display of the different slots of the Spine animation in different layers using the skeleton_slot_color_set function, but I need to test it more.

Additional context

The following links are useful for more information : https://esotericsoftware.com/spine-unity#SkeletonRenderSeparator https://wulverblade.com/character-interactions/

KormexGit commented 1 year ago

You can indeed use skeleton_slot_color_set as a workaround, though a rather clunky one. You'd need to draw the spine sprite from two separate objects, since you can't draw at multiple depths from a single object. So, from a separate object with higher depth, you'd use a with statement on the main spine object, use skeleton_slot_color_set and set the alpha of every slot you don't want to draw to 0, then draw_self(). Then from the main spine object (at a lower depth), use skeleton_slot_color_set a bunch more to swap the alphas, and draw_self() again. I've used this method to apply shaders to specific slots.

It's an awkward way to do it though, and an easier way to draw slots separately would be much appreciated.