From 1444af8f63ca17c1d9bcb9ddc8826cfab9a08a5d Mon Sep 17 00:00:00 2001 From: Nicholas Hammond Date: Tue, 20 Dec 2022 10:44:19 -0600 Subject: [PATCH] Glow :) Applied suggestion from dodo.the.last in https://mods.factorio.com/mod/nixie-tubes/discussion/5a5f1b0dadcc441024d75de5 --- prototypes/nixie.lua | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/prototypes/nixie.lua b/prototypes/nixie.lua index cd13636..7a2348e 100644 --- a/prototypes/nixie.lua +++ b/prototypes/nixie.lua @@ -214,18 +214,33 @@ data:extend{ } function nixie_sprite(char,xoffset,yoffset) - return { + return { type = "sprite", name = "nixie-tube-sprite-" .. char, - filename = "__nixie-tubes__/graphics/nixie-chars-mono.png", - x = xoffset * 40, -- Increase the offset by image table - y = yoffset * 88, - width = 40, -- New size image 2x - height = 88, -- New size image 2x - scale = 0.5, -- Reduced so that the sprite does not crawl over the edges - apply_runtime_tint = true, - shift = {-2/64,-18/64}, -- Move the sprite to fit into the tube + layers = { + { + filename = "__nixie-tubes__/graphics/nixie-chars-mono.png", + x = xoffset * 40, -- Increase the offset by image table + y = yoffset * 88, + width = 40, -- New size image 2x + height = 88, -- New size image 2x + scale = 0.5, -- Reduced so that the sprite does not crawl over the edges + apply_runtime_tint = true, + shift = {-2/64,-18/64}, -- Move the sprite to fit into the tube + }, + { + filename = "__nixie-tubes__/graphics/nixie-chars-mono.png", -- could have separate glow layer ! + x = xoffset * 40, -- Increase the offset by image table + y = yoffset * 88, + width = 40, -- New size image 2x + height = 88, -- New size image 2x + scale = 0.5, -- Reduced so that the sprite does not crawl over the edges + apply_runtime_tint = true, + shift = {-2/64,-18/64}, -- Move the sprite to fit into the tube + draw_as_glow = true, -- <------------ magic + } } + } end local spritelist =