Skip to content

TextureWidget

Base widget for rendering textures, UV regions, nine-slice borders, and image handles.

Overview

TextureWidget displays textures represented by TextureHandle. Supports texture filtering modes (linear/nearest), wrap modes (clamp/repeat), mipmapping, and source UV coordinates.

Rendering Texture

TextureWidget icon = new TextureWidget(TextureHandle.of("mod:textures/gui/icon.png"))
        .textureSampling(TextureFilter.NEAREST);

API

TextureWidget::texture(TextureHandle)

Texture Handle

Returns or sets TextureHandle referenced by widget.

Parameter Type Description
texture TextureHandle —

Returns TextureWidget.

TextureWidget::textureSampling(TextureFilter)

Texture Sampling

Sets texture filtering mode (NEAREST or LINEAR).

Parameter Type Description
filter TextureFilter —

Returns TextureWidget.

TextureWidget::textureWrap(TextureWrap)

Texture Wrap

Sets texture wrapping mode (CLAMP or REPEAT).

Parameter Type Description
wrap TextureWrap —

Returns TextureWidget.