(I have messed arround with that but I cant find out how it works)
Also,I wanna know if it is possible to change the background of the frame
Also, the GUI buttons look much better now with style

Code: Select all
data:extend({
soldering_iron =
{
type = "monolith",
top_monolith_border = 1,
right_monolith_border = 1,
bottom_monolith_border = 1,
left_monolith_border = 1,
monolith_image =
{
filename = "__F-mod__/resources/other/chipset.png",
width = 220,
height = 220,
x = 0,
y = 0
}
}
})
Code: Select all
game.player.gui.left.add({type="frame", name="menu", caption="Change frequency",direction="vertical",style="soldering_iron"})
Code: Select all
data:extend({
type = "gui-style",
name = "f-mod",
soldering_iron =
{
type = "frame_style",
font = "default-frame",
font_color = {r=1, g=1, b=1},
-- padding of the title area of the frame, when the frame title
-- is empty, the area doesn't exist and these values are not used
title_top_padding = 0,
title_left_padding = 0,
title_bottom_padding = 15,
title_right_padding = 0,
-- padding of the content area of the frame
top_padding = default_container_padding - 6,
right_padding = default_container_padding,
bottom_padding = default_container_padding,
left_padding = default_container_padding,
graphical_set =
{
type = "composition",
filename = "__F-mod__/resources/other/chipset.png",
corner_size = {220,220},
position = {0, 0}
},
flow_style=
{
horizontal_spacing = default_container_padding,
vertical_spacing = default_container_padding
}
},
})
Code: Select all
local soldering_iron =
{
type="frame_style",
parent="frame_style",
graphical_set=
{
type = "monolith",
top_monolith_border = 1,
right_monolith_border = 1,
bottom_monolith_border = 1,
left_monolith_border = 1,
monolith_image =
{
filename = "__F-mod__/resources/other/chipset.png",
width = 220,
height = 220,
x = 0,
y = 0
}
}
}
-- Here I extend the default gui style with the soldering_iron style.
data.raw["gui-style"].default["soldering_iron"] = soldering_iron
... 0.5.2 and 0.5.3kovarex wrote:P.S. Unfortunately, when testing this, I discovered a bug in the processing of custom gui elements, when I repaired it, it worked, but in the current 1.5.2 it won't work, with other small bugs, to have 1.5. really stable, I think we should make 1.5.3 as well
@kovarex: Is there a way to prevent the monolith from scaling?kovarex wrote:Yes, you can change the background.
The monolith is the most simple, you just provide one image, and it is used to draw the background of the element. The image is stretched to fit the size of the element.