ImageWidget

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.
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"));javascript
imageWidget.setImage(() => new ResourceTexture("ldlib:textures/gui/icon.png"));getImage
Returns the current image texture.
java
var texture = imageWidget.getImage();setBorder

Sets the border width and color.
java
imageWidget.setBorder(2, 0xFFFFFFFF); // ARGB