Skip to content

ImageWidget ​

Image title

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

Basic Properties ​

FieldDescription
borderThe border width (range: -100 to 100)
borderColorThe color of the border

APIs ​

setImage ​

Sets the image texture using a texture instance.

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

setImage ​

Sets the image texture using a supplier.

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

getImage ​

Returns the current image texture.

java
var texture = imageWidget.getImage();

setBorder ​

Image title

Sets the border width and color.

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

Released under the MIT License.