Skip to content

ImageWidget

Image title

ImageWidget is used to display images, which provided by a GUI Texture.

Basic Properties

Field Description
border The border width (range: -100 to 100)
borderColor The color of the border

APIs

setImage

Sets the image texture using a texture instance.

imageWidget.setImage(new ResourceTexture("ldlib:textures/gui/icon.png"));

setImage

Sets the image texture using a supplier.

imageWidget.setImage(() -> new ResourceTexture("ldlib:textures/gui/icon.png"));
imageWidget.setImage(() => new ResourceTexture("ldlib:textures/gui/icon.png"));

getImage

Returns the current image texture.

var texture = imageWidget.getImage();

setBorder

Image title

Sets the border width and color.

imageWidget.setBorder(2, 0xFFFFFFFF); // ARGB