Jump to content
  • 0

Help Actor switch color ?


EL Dragon

Question


  • Group:  Members
  • Topic Count:  86
  • Topics Per Day:  0.02
  • Content Count:  591
  • Reputation:   146
  • Joined:  06/19/12
  • Last Seen:  

is such a thing possible? 

 

z.b  Script:

 

act.SetColor("#760ED1F4");

TO

act.SetColor("#763D0EF4");

 

 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  660
  • Reputation:   668
  • Joined:  11/12/12
  • Last Seen:  

Yes, the color component can be modified :

foreach (var action in act) {
    foreach (var frame in action) {
        foreach (var layer in frame) {
            if (layer.Color == "#760ED1F4") {
                layer.Color = "#763D0EF4";
            }
        }
    }
}

You could also go for...

foreach (var action in act) {
    foreach (var frame in action) {
        foreach (var layer in frame) {
            var c = layer.Color;
            layer.Color = GrfColor.FromHsv(0.76f, c.Saturation, c.Brightness, c.A);
        }
    }
}

On a side note, this is Act Editor, not Actor ;O.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  19
  • Reputation:   1
  • Joined:  12/31/11
  • Last Seen:  

On 13/05/2015 at 9:34 PM, Tokei said:

Yes, the color component can be modified :


foreach (var action in act) {
    foreach (var frame in action) {
        foreach (var layer in frame) {
            if (layer.Color == "#760ED1F4") {
                layer.Color = "#763D0EF4";
            }
        }
    }
}

You could also go for...


foreach (var action in act) {
    foreach (var frame in action) {
        foreach (var layer in frame) {
            var c = layer.Color;
            layer.Color = GrfColor.FromHsv(0.76f, c.Saturation, c.Brightness, c.A);
        }
    }
}

On a side note, this is Act Editor, not Actor ;O.

Hello everyone, sorry do revive this topic but how can i make this into a lua script for actor?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  86
  • Topics Per Day:  0.02
  • Content Count:  591
  • Reputation:   146
  • Joined:  06/19/12
  • Last Seen:  

thx for help  /no1

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...