Skip to content

Change attachment color #13

@gbelintani

Description

@gbelintani

Hi!
I'm trying to change the attachment color at runtime using the same logic I can do in Unity.
I'm using this code, but nothing happens. Am I doing something wrong here?


for (var slot in skeleton.slots){
    if(slot.data.name.contains('Base-')){
      var attachment = skeleton.getAttachment(slot.data.index, slot.data.name);
      if(attachment == null) continue;

      var regionAttachment = attachment as spine_core.RegionAttachment;

      if(regionAttachment != null){
        regionAttachment.color.setFromString('FF0000');
        regionAttachment.updateOffset();
      }
    }
  }

I also tried setting skeleton.color and methods like skeleton.setToSetupPose(); but no luck.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions