Paint callback?

Hey all, I’m trying to make a custom script or brush that will draw the same thing on all selected layers. I’m wondering if there’s a callback for when you draw with a pencil with the necessary data like Point and layer?

I’ve tried using onsitechange but I don’t think it provides this data and I’m new to lua so idk how to inspect the ev table param it provides.

Thanks for any help :smiley:

You might want to look into the onchange event of a Sprite instead. It’s triggered every time any change is made to the sprite you’re subscribed to, including (but not limited to) drawing with a pencil.

All changes are always applied on the active sites so you can get all of them by getting the app.activeLayer, app.activeFrame, and app.activeCel.
You’re not going to get information about user input (where the user clicked, what pixels were placed) but if you really need this information, I wrote a short thread about a simple method to approximate that - here.

3 Likes

ahh that unfortunate, but thanks for the info, ill give your methods a shot!