Jump to content
  • 0

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


Question

Posted

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,

1 answer to this question

Recommended Posts

  • 0
Posted

hi bro.sory im not answr ur question
i just want to ask
how to put [selectedActionIndex] in ur script ?

i wantt use ur script only in selected action

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

        }
    }
}

can someone help me please ?
thankyou

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...