How do I apply tint to sprites?
Posted: Tue Sep 26, 2023 11:54 am
Hi everyone,
I'm just dipping my toes into modding for the first time, and I've got stuck on applying tints to sprites.
I'm working on a electric pole with maximum supply distance, and I'd like it to be a different colour.
I've figured out how to tint the icon, but not the sprite.
This is what I've got so far:
Side note: I'm not sure if I should start a new topic for this, but I can't figure out subgroup order either. It's currently sitting at the end of the logistics group, but I'm not sure how to get it to sit up with its buds in the electric poles and pipes.
I'm just dipping my toes into modding for the first time, and I've got stuck on applying tints to sprites.
I'm working on a electric pole with maximum supply distance, and I'd like it to be a different colour.
I've figured out how to tint the icon, but not the sprite.
This is what I've got so far:
Code: Select all
local maxDistanceElectricPole = table.deepcopy(data.raw["electric-pole"]["big-electric-pole"])
maxDistanceElectricPole.name = "max-distance-electric-pole"
maxDistanceElectricPole.localised_description = {"item-description.max-distance-electric-pole"}
maxDistanceElectricPole.supply_area_distance = 64
maxDistanceElectricPole.maximum_wire_distance = 64
maxDistanceElectricPole.subgroup = "energy-pipe-distribution"
maxDistanceElectricPole.icons = {
{
icon = maxDistanceElectricPole.icon,
tint = {r= 1.0, g = 0.5, b = 0.5, a = 1}
}
}
data:extend{maxDistanceElectricPole}