Adding Sprite to Entity?

Place to get help with not working mods / modding interface.
PrimeEagle
Burner Inserter
Burner Inserter
Posts: 12
Joined: Wed Oct 12, 2022 9:51 pm
Contact:

Adding Sprite to Entity?

Post by PrimeEagle »

How would I add the yellow input/output arrows from Decider Combinators to my own entity and icon? I looked at the vanilla Decider Combinator definitons and didn't see anything in there.
User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3717
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Adding Sprite to Entity?

Post by DaveMcW »

It is defined as data.raw["utility-sprites"]["default"].indication_arrow.filename = "__core__/graphics/arrows/indication-arrow.png"

If you want to use it in 4 rotations, you will have to copy and rotate the file in an image editor.
PrimeEagle
Burner Inserter
Burner Inserter
Posts: 12
Joined: Wed Oct 12, 2022 9:51 pm
Contact:

Re: Adding Sprite to Entity?

Post by PrimeEagle »

DaveMcW wrote: Thu Oct 13, 2022 12:25 am It is defined as data.raw["utility-sprites"]["default"].indication_arrow.filename = "__core__/graphics/arrows/indication-arrow.png"

If you want to use it in 4 rotations, you will have to copy and rotate the file in an image editor.
I found the definition, but I'm not sure how to use it. Is there an example that shows how to layer it on top of the entity icon and position it?
User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3717
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Adding Sprite to Entity?

Post by DaveMcW »

What is the Prototype type of your entity? They all have different graphics requirements.
PrimeEagle
Burner Inserter
Burner Inserter
Posts: 12
Joined: Wed Oct 12, 2022 9:51 pm
Contact:

Re: Adding Sprite to Entity?

Post by PrimeEagle »

DaveMcW wrote: Thu Oct 13, 2022 12:40 am What is the Prototype type of your entity? They all have different graphics requirements.
It's a variation of constant-combinator.
User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3717
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Adding Sprite to Entity?

Post by DaveMcW »

constant-combinator has 4 directions that you need to define. Here is an example for north.

Code: Select all

data.raw["constant-combinator"]["constant-combinator"].sprites.north = {
  layers = {
    {
      filename = "__base__/graphics/entity/combinator/constant-combinator.png",
      frame_count = 1,
      height = 52,
      hr_version = {
        filename = "__base__/graphics/entity/combinator/hr-constant-combinator.png",
        frame_count = 1,
        height = 102,
        priority = "high",
        scale = 0.5,
        shift = {0, 0.15625},
        width = 114,
        x = 0,
        y = 0
      },
      priority = "high",
      scale = 1,
      shift = {0, 0.15625},
      width = 58,
      x = 0,
      y = 0
    },
    {
      filename = "__core__/graphics/arrows/indication-arrow.png",
      priority = "high",
      width = 64,
      height = 64,
      scale = 0.5,
      x = 0,
      y = 0,
      shift = {0, -0.5},
    },
    {
      draw_as_shadow = true,
      filename = "__base__/graphics/entity/combinator/constant-combinator-shadow.png",
      frame_count = 1,
      height = 34,
      hr_version = {
        draw_as_shadow = true,
        filename = "__base__/graphics/entity/combinator/hr-constant-combinator-shadow.png",
        frame_count = 1,
        height = 66,
        priority = "high",
        scale = 0.5,
        shift = {0.265625, 0.171875},
        width = 98,
        x = 0,
        y = 0
      },
      priority = "high",
      scale = 1,
      shift = {0.265625, 0.171875},
      width = 50,
      x = 0,
      y = 0
    }
  }
}
PrimeEagle
Burner Inserter
Burner Inserter
Posts: 12
Joined: Wed Oct 12, 2022 9:51 pm
Contact:

Re: Adding Sprite to Entity?

Post by PrimeEagle »

DaveMcW wrote: Thu Oct 13, 2022 1:18 am constant-combinator has 4 directions that you need to define. Here is an example for north.

Code: Select all

data.raw["constant-combinator"]["constant-combinator"].sprites.north = {
  layers = {
    {
      filename = "__base__/graphics/entity/combinator/constant-combinator.png",
      frame_count = 1,
      height = 52,
      hr_version = {
        filename = "__base__/graphics/entity/combinator/hr-constant-combinator.png",
        frame_count = 1,
        height = 102,
        priority = "high",
        scale = 0.5,
        shift = {0, 0.15625},
        width = 114,
        x = 0,
        y = 0
      },
      priority = "high",
      scale = 1,
      shift = {0, 0.15625},
      width = 58,
      x = 0,
      y = 0
    },
    {
      filename = "__core__/graphics/arrows/indication-arrow.png",
      priority = "high",
      width = 64,
      height = 64,
      scale = 0.5,
      x = 0,
      y = 0,
      shift = {0, -0.5},
    },
    {
      draw_as_shadow = true,
      filename = "__base__/graphics/entity/combinator/constant-combinator-shadow.png",
      frame_count = 1,
      height = 34,
      hr_version = {
        draw_as_shadow = true,
        filename = "__base__/graphics/entity/combinator/hr-constant-combinator-shadow.png",
        frame_count = 1,
        height = 66,
        priority = "high",
        scale = 0.5,
        shift = {0.265625, 0.171875},
        width = 98,
        x = 0,
        y = 0
      },
      priority = "high",
      scale = 1,
      shift = {0.265625, 0.171875},
      width = 50,
      x = 0,
      y = 0
    }
  }
}
Thank you!!
Post Reply

Return to “Modding help”