OpenMiner/docs/lua-api-gui-image.md
2020-03-12 23:39:14 +01:00

714 B

Lua API: Image

Example

gui:image {
	name = "img_background", -- mandatory
	pos = {x = 0, y = 0},    -- mandatory

	texture = "mods/default/textures/gui/workbench.png",
	clip = {x = 0, y = 0, width = 176, height = 166},
}

Attributes

clip

Clip rect of the texture.

Example:

clip = {
	x = 0,
	y = 0,
	width = 176,
	height = 166
}

name

Name of the widget. Mandatory field.

Example:

name = "img_background"

pos

Position of the widget. Mandatory field.

Example:

pos = {
	x = 0,
	y = 0
}

texture

Full path of the texture. Relative to the repo root.

Example:

texture = "mods/default/textures/gui/workbench.png"