# \[SOLVED\] Character customization & Spine \> 3 questions

**URL:** <https://forum.defold.com/t/solved-character-customization-spine-3-questions/70981>\
**Category:** Questions\
**Created:** [May 23, 2022, 9:21am UTC](https://forum.defold.com/t/solved-character-customization-spine-3-questions/70981 "2022-05-23T09:21:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ragetto](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/ragetto/32/32785_2.png) [@Ragetto](https://forum.defold.com/u/Ragetto)\
**Post date:** [May 23, 2022, 9:21am UTC](https://forum.defold.com/t/solved-character-customization-spine-3-questions/70981/1 "2022-05-23T09:21:14Z")

</div>

Hi!

I would have 3 questions about Spine.  
Maybe each of them should be in a separate post 🤔 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?_

 ![image](https://forum-defold-uploads.b-cdn.net/original/3X/c/4/c43bf5da0afd3f7f4c3545ca924fc5ad2f8445cc.png)

_edit2: I just realize it would be great to make my characters look angry 🤭_

* * *

**2/ How to mask/clipping an attachement?**  
ex:

 ![image](https://forum-defold-uploads.b-cdn.net/original/3X/3/a/3a6466ee43a0fb5a7ed43608770f638ec18ca9b0.png)  
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 🙂

---

<div class="post-metadata">

**Author:** ![Mathias\_Westerdahl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mathias_westerdahl/32/228_2.png) [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Post date:** [May 23, 2022, 9:40am UTC](https://forum.defold.com/t/solved-character-customization-spine-3-questions/70981/2 "2022-05-23T09:40:38Z")

</div>

1: If the spine-c api supports it, we should be able to as well.  
We currently use the colors of the [attachment](https://github.com/defold/extension-spine/blob/main/defold-spine/commonsrc/vertices.cpp#L103-L106)

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](https://github.com/defold/extension-spine) repo for the feature requests.

You’ll find the official spine-c runtime [here](https://github.com/EsotericSoftware/spine-runtimes/tree/4.0/spine-c), and the documentation [here](http://en.esotericsoftware.com/spine-c).
