multiple layers of sprites with some blending mode other than simply overlapping.
Posted: Tue Sep 29, 2020 5:10 am
I read this,
viewtopic.php?t=26105
But I didn't success trying this.
In my mod, I tried to modify the tint(or should I say color directly?) of offshore pump.
I tried deepcopy, and then new_pump.graphics_set.animation.north.layers[1].filename = something else.
I'm curious about that, is it possible to create something like modifying image layer and put it on the top.
layers[3] = layers[2]//this layer is shadow.
layers[2] = layers[1].deepcopy()//this layer is the main body, and the code is pseudo.
layers[1].filename = nil
layers[1].layer_mode = modifying-layer
layers[1].blend_mode = hue-sat-vol
layers[1].delta_hue = 120
layers[1].delta_saturation = 30
layers[1].delta_volume = -5
...
data:extend({this new offshore pump})
In this way, it's very easy to change prototypes' color.
For now, the easiest way I knew is that, copy the png of the mainbody, paste into the mod folder. Modify the png file. Specify the filename to the new png. But if the blending mode is not variable within the whole playing duration, it doesn't bring any perfomance overhead to the game. And I think modifying an loaded png is faster than loading another png.
viewtopic.php?t=26105
But I didn't success trying this.
In my mod, I tried to modify the tint(or should I say color directly?) of offshore pump.
I tried deepcopy, and then new_pump.graphics_set.animation.north.layers[1].filename = something else.
I'm curious about that, is it possible to create something like modifying image layer and put it on the top.
layers[3] = layers[2]//this layer is shadow.
layers[2] = layers[1].deepcopy()//this layer is the main body, and the code is pseudo.
layers[1].filename = nil
layers[1].layer_mode = modifying-layer
layers[1].blend_mode = hue-sat-vol
layers[1].delta_hue = 120
layers[1].delta_saturation = 30
layers[1].delta_volume = -5
...
data:extend({this new offshore pump})
In this way, it's very easy to change prototypes' color.
For now, the easiest way I knew is that, copy the png of the mainbody, paste into the mod folder. Modify the png file. Specify the filename to the new png. But if the blending mode is not variable within the whole playing duration, it doesn't bring any perfomance overhead to the game. And I think modifying an loaded png is faster than loading another png.