Using sprites in gui
Posted: Sat Aug 18, 2018 3:57 am
Hi, I would like to use some type of a separator for my gui frame. I tried creating a second frame right below it and was hoping for similar effect of what you get from "inventory and Crafting" wiondow where they are right beside each other, but it got created with a spacing and with a diff size. I assume flow would be needed to do that, but I never seen it done. So I tried using a graphic "sprite":
where sprite was:
color was bright red, so even with the 2 pixel height it should be noticeable, but nothing showed up, and no error neither. I am hoping for something similar to the vertical lines you see in resource screen when you start a new game.
I really enjoy modding this game but find it very hard to figure out how to change/add specifics. I often find it either through browsing data file itself or through different mods. I expect this to be handled by something like
data.raw["gui-style"].default["some-button-style"] =
since its for gui, but I could not find any resource to figure it out since "sprite_style" type doest work. Wiki is very vague when it come to implementation or listing full functionality so I turn to you guys again. Thanks for help in advance.
Code: Select all
frame["sar-table3"].add{type = "sprite", name="sar-table-separator"}
Code: Select all
data:extend({
-- sprites
{
type = "sprite",
name = "sar-table-separator",
filename = "__SpaceFlight__/graphics/separator.png",
priority = "extra-high-no-scale",
width = 32,
height = 2
}
})
I really enjoy modding this game but find it very hard to figure out how to change/add specifics. I often find it either through browsing data file itself or through different mods. I expect this to be handled by something like
data.raw["gui-style"].default["some-button-style"] =
since its for gui, but I could not find any resource to figure it out since "sprite_style" type doest work. Wiki is very vague when it come to implementation or listing full functionality so I turn to you guys again. Thanks for help in advance.