Jump to content
  • 0
Sign in to follow this  
xinfinite

Act Editor Need Help With Scripting - Add layer to every frame

Question

Hi, I have little to no experience in coding but I try to learn through trial and error.

I'm trying to write a simple script in Act Editor that adds Sprite Index number 116 to every frame of every action of an existing sprite.

This is what I have so far, in which, it changed every layer to sprite number 116 with the offsets.

 

foreach (var action in act) {
    foreach (var frame in action) {
        foreach (var layer in frame) {
            layer.SpriteIndex = 116;
            layer.OffsetX = 1;
            layer.OffsetY = -120;

        }
    }
}

 

I tried looking up the 'Help' section of Act Editor, but there isn't a section about Insert/Add new layers.

Can anyone assist me with this?

 

Thanks,

Share this post


Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.