Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Tint a Spine slot #6

Open
kimsyv-paf opened this issue Oct 9, 2018 · 2 comments
Open

Tint a Spine slot #6

kimsyv-paf opened this issue Oct 9, 2018 · 2 comments

Comments

@kimsyv-paf
Copy link

Would it be possible to add the possibility to tint a Spine slot? Tinting an entire Spine object with heaven works fine, but I cannot tint separate slots this way. Tinting a slot the "normal" way works (i.e. with the tint property), but that way I cannot make the entire slot one color (except black ofc).

@ivanpopelyshev
Copy link
Collaborator

According to https://github.com/pixijs/pixi-spine/blob/master/src/Spine.ts#L379 sprite or mesh color is calculated based on spine tint and attachment tint.

var ind = spine.skeleton.getSlotIndex('mySlot');
spine.skeleton.slots[ind].attachment.r = 1.0;
spine.update(0); // call if you dont update it automatically
// it changes spine.slotContainers[ind].children[0].color

@ivanpopelyshev
Copy link
Collaborator

You can also change that part in Spine.ts and make a flag for manual tinting in container, that way if you change container child tint manually spine wont overwrite it.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants