Page 1 of 1
Adding Sprite to Entity?
Posted: Wed Oct 12, 2022 9:53 pm
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.
Re: Adding Sprite to Entity?
Posted: Thu Oct 13, 2022 12:25 am
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.
Re: Adding Sprite to Entity?
Posted: Thu Oct 13, 2022 12:27 am
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?
Re: Adding Sprite to Entity?
Posted: Thu Oct 13, 2022 12:40 am
by DaveMcW
What is the
Prototype type of your entity? They all have different graphics requirements.
Re: Adding Sprite to Entity?
Posted: Thu Oct 13, 2022 12:48 am
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.
Re: Adding Sprite to Entity?
Posted: Thu Oct 13, 2022 1:18 am
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
}
}
}
Re: Adding Sprite to Entity?
Posted: Thu Oct 13, 2022 1:33 am
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!!