Adding Sprite to Entity?
-
- Burner Inserter
- Posts: 12
- Joined: Wed Oct 12, 2022 9:51 pm
- Contact:
Adding Sprite to Entity?
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.
Re: Adding Sprite to Entity?
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.
If you want to use it in 4 rotations, you will have to copy and rotate the file in an image editor.
-
- Burner Inserter
- Posts: 12
- Joined: Wed Oct 12, 2022 9:51 pm
- Contact:
Re: Adding Sprite to Entity?
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?
Re: Adding Sprite to Entity?
What is the Prototype type of your entity? They all have different graphics requirements.
-
- Burner Inserter
- Posts: 12
- Joined: Wed Oct 12, 2022 9:51 pm
- Contact:
Re: Adding Sprite to Entity?
It's a variation of constant-combinator.DaveMcW wrote: ↑Thu Oct 13, 2022 12:40 am What is the Prototype type of your entity? They all have different graphics requirements.
Re: Adding Sprite to Entity?
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
}
}
}
-
- Burner Inserter
- Posts: 12
- Joined: Wed Oct 12, 2022 9:51 pm
- Contact:
Re: Adding Sprite to Entity?
Thank you!!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 } } }