Page 1 of 1

Creating a new texture programmatically?

Posted: Wed Aug 17, 2016 8:33 pm
by doktorstick
Howdy. When I tweaked the splitters in my mod, I manually edited every animation frame in Paint.NET to dinstinguish them visually from the default splitters (four direction facings, three splitter types, and 32 animation frames).

In thinking about supporting other mod author's splitters natively, I was wondering if there is a better way to accomplish the different look--like with a texture overlay or something. I imagine this is possible because it's done with circuit network connections.

Would someone mind outlining what I would need to do to accomplish this? I'm a complete graphics/animation newbie, so I'm not sure where to start or what to search for to find out. :D

Thanks!

Re: Creating a new texture programmatically?

Posted: Sat Aug 20, 2016 7:06 pm
by Adil
Well, have look at how default entities are defined. Most of them list several layers in their animations. If you need, you can modify the tint value of the layer, add new layers, including masks of various degree of transparency (tint with alpha value less than 1).
The algorithm is pretty much standard one, you modify data.raw after the entities of interest are known to be included (to do that you either list relevant mods as dependencies for your one, or use data-updates.lua or later.) .

Re: Creating a new texture programmatically?

Posted: Mon Aug 22, 2016 7:55 pm
by doktorstick
Yeah, I figured it out. The item in question had it's animation defined in a top-level table. By moving that definition into a newly created sub-table called layers, i was able to add another animation frame that's my texture overlay. It took some hunting around to find the magic sauce (i.e., that sub-table). Thanks.

Re: Creating a new texture programmatically?

Posted: Tue Jul 25, 2017 11:09 am
by Xerus
could I get some more detail on how to do this? I can't find any documentation...