[SOLVED] Character customization & Spine > 3 questions

Hi!

I would have 3 questions about Spine.
Maybe each of them should be in a separate post :thinking: You tell me.


1/ How to dynamically colorize attachments at runtime?
I’m currently implementing a character customization system, but now I’d like to handle the haircuts/facial hair colors more smartly (to reduce the number of images)

Ex: instead of having 30 haircuts in 10 colors (300 images), I’d like to have 30 haircuts in white/greyscale that I would dynamically color at runtime (30 images).

This is something developers do in my company (on Unity), is it possible with Defold?
(would be super useful for any customization system)

edit: on Spine it’s possible to colorize an attachment, so maybe there is something to do with that? Is there a way to toy with this parameter at runtime in Defold?

edit2: I just realize it would be great to make my characters look angry :face_with_hand_over_mouth:


2/ How to mask/clipping an attachement?
ex:
image
I suppose I could have 2 versions for each “haircut” item (1 full / 1 without the top part), but… it would make too many images if I can’t dynamically colorize them (cf above).


3/ How to get the “size” (width/height) of a spine model/attachement? (no direct link with the custo system though… just out of curiosity)
If not possible, I could add an invisible sprite to the game object and get its size, but perhaps there is a more subtle/elegant solution.


Thanks :slight_smile:

1 Like

1: If the spine-c api supports it, we should be able to as well.
We currently use the colors of the attachment

3: If the spine-c api supports it, we should be able to add a function for it as well.

Note that by “we”, I mean the community (ourselves included).
Add tickets to the extension-spine repo for the feature requests.

You’ll find the official spine-c runtime here, and the documentation here.

2 Likes