Picture layers and variative of pictures

Place to get help with not working mods / modding interface.
Post Reply
User avatar
DemerNkardaz
Inserter
Inserter
Posts: 26
Joined: Wed Jan 18, 2023 12:32 am
Contact:

Picture layers and variative of pictures

Post by DemerNkardaz »

Hi, have some stuck with using layers and variants of sprite simultaneously, with this code game shows only first variant and I don't remember how to make it fully workable.
And second small question — It's bad to add light glow for items (if it's possible, I have not tested this current time), can this be laggy for performance with fully filled belts or all okay?

Image

Code: Select all

	{
		type = "item",
		name = "PLORD_uranium_ingot_enriched",
		icon = "__PLORD__/graphics/icons/uranium/uranium_ingot_luminiscent_alt.png",
		icon_size = 128, icon_mipmaps = 4,
		subgroup = "PLORD_grp_metals_ingots",
		order = "z",
		stack_size = settings.startup["PLORD_res_cstm_stack_ingots"].value,
		pictures = {
			layers = {
				{filename="__PLORD__/graphics/icons/uranium/uranium_ingot_luminiscent_01.png", size=128, scale=0.17},
				{draw_as_light = true, filename="__PLORD__/graphics/icons/uranium/uranium_ingot_luminiscent_glow_01.png", flags = {"light"}, size=128, scale=0.17}
			},
			layers = {
				{filename="__PLORD__/graphics/icons/uranium/uranium_ingot_luminiscent_02.png", size=128, scale=0.17},
				{draw_as_light = true, filename="__PLORD__/graphics/icons/uranium/uranium_ingot_luminiscent_glow_02.png", flags = {"light"}, size=128, scale=0.17}
			},
			layers = {
				{filename="__PLORD__/graphics/icons/uranium/uranium_ingot_luminiscent_03.png", size=128, scale=0.17},
				{draw_as_light = true, filename="__PLORD__/graphics/icons/uranium/uranium_ingot_luminiscent_glow_03.png", flags = {"light"}, size=128, scale=0.17}
			},
			layers = {
				{filename="__PLORD__/graphics/icons/uranium/uranium_ingot_luminiscent_04.png", size=128, scale=0.17},
				{draw_as_light = true, filename="__PLORD__/graphics/icons/uranium/uranium_ingot_luminiscent_glow_04.png", flags = {"light"}, size=128, scale=0.17}
			}
		}
	},

User avatar
Silari
Filter Inserter
Filter Inserter
Posts: 492
Joined: Sat Jan 27, 2018 10:04 pm
Contact:

Re: Picture layers and variative of pictures

Post by Silari »

Pictures is created wrong. You don't want to use layers, you want to set it as an array inside of pictures.

See the example at the wiki or iron-ore from the game:

Code: Select all

pictures = {
        {
          filename = "__base__/graphics/icons/iron-ore.png",
          mipmap_count = 4,
          scale = 0.25,
          size = 64
        },
        {
          filename = "__base__/graphics/icons/iron-ore-1.png",
          mipmap_count = 4,
          scale = 0.25,
          size = 64
        },
        {
          filename = "__base__/graphics/icons/iron-ore-2.png",
          mipmap_count = 4,
          scale = 0.25,
          size = 64
        },
        {
          filename = "__base__/graphics/icons/iron-ore-3.png",
          mipmap_count = 4,
          scale = 0.25,
          size = 64
        }
      },

User avatar
DemerNkardaz
Inserter
Inserter
Posts: 26
Joined: Wed Jan 18, 2023 12:32 am
Contact:

Re: Picture layers and variative of pictures

Post by DemerNkardaz »

Silari wrote:
Sat May 13, 2023 2:21 pm
Pictures is created wrong. You don't want to use layers, you want to set it as an array inside of pictures.

See the example at the wiki or iron-ore from the game:
No, this is works with only one texture, I need to use two textures in one picture — base texture and glow. But I found my mistake, I just lost {} brackets before "layers" param. Now it works (But I have tried place {} like this before and this didn't work, I was close to true code, but something went wrong then).
ImageImage

Code: Select all

pictures =
 {
  {
   layers =
  	{
  	  {filename="__PLORD__/graphics/icons/uranium/uranium_ingot_luminiscent_01.png", size=128, scale=0.17},
  	  {filename="__PLORD__/graphics/icons/uranium/uranium_ingot_luminiscent_glow_01.png", blend_mode = "additive", draw_as_light = true, size = 128, scale = 0.17,
  	  tint = {r = 0.3, g = 0.3, b = 0.3, a = 0.3}, flags = {"light"}}
  	}
  },
  {
   layers =
  	{
  	  {filename="__PLORD__/graphics/icons/uranium/uranium_ingot_luminiscent_02.png", size=128, scale=0.17},
  	  {filename="__PLORD__/graphics/icons/uranium/uranium_ingot_luminiscent_glow_02.png", blend_mode = "additive", draw_as_light = true, size = 128, scale = 0.17,
  	  tint = {r = 0.3, g = 0.3, b = 0.3, a = 0.3}, flags = {"light"}}
  	}
  },
  {
   layers =
  	{
  	  {filename="__PLORD__/graphics/icons/uranium/uranium_ingot_luminiscent_03.png", size=128, scale=0.17},
  	  {filename="__PLORD__/graphics/icons/uranium/uranium_ingot_luminiscent_glow_03.png", blend_mode = "additive", draw_as_light = true, size = 128, scale = 0.17,
  	  tint = {r = 0.3, g = 0.3, b = 0.3, a = 0.3}, flags = {"light"}}
  	}
  },
  {
   layers =
  	{
  	  {filename="__PLORD__/graphics/icons/uranium/uranium_ingot_luminiscent_04.png", size=128, scale=0.17},
  	  {filename="__PLORD__/graphics/icons/uranium/uranium_ingot_luminiscent_glow_04.png", blend_mode = "additive", draw_as_light = true, size = 128, scale = 0.17,
  	  tint = {r = 0.3, g = 0.3, b = 0.3, a = 0.3}, flags = {"light"}}
  	}
  },
 }

Post Reply

Return to “Modding help”