Skip to content

GuiTextureGroup

Since 2.2.1

GuiTextureGroup draws multiple IGuiTexture instances stacked on top of each other in the order they were added. It is useful for combining a background image with an overlay, or layering a border over a fill.

Registry name: group_texture

INFO

Extends TransformTexture — supports rotate(), scale(), transform().


Usage

java
// Layer a sprite background and a coloured border
IGuiTexture layered = IGuiTexture.group(
    SpriteTexture.of("mymod:textures/gui/bg.png"),
    new ColorBorderTexture(1, 0xFFFFFFFF)
);

// Equivalent static factory
IGuiTexture same = GuiTextureGroup.of(
    SpriteTexture.of("mymod:textures/gui/bg.png"),
    new ColorBorderTexture(1, 0xFFFFFFFF)
);

LSS

css
background: group(
    sprite(mymod:textures/gui/bg.png),
    rect(#FFFFFF22, 2)
);

Fields

NameTypeDescription
texturesIGuiTexture[]The textures drawn in order (bottom to top).

Methods

MethodReturnsDescription
GuiTextureGroup.of(IGuiTexture...)GuiTextureGroupStatic factory. Equivalent to IGuiTexture.group(...).
setTextures(IGuiTexture...)GuiTextureGroupReplaces all textures in the group.
setColor(int)GuiTextureGroupCopies all textures, applies setColor(color) to each, and returns a new group.
copy()GuiTextureGroupReturns a shallow copy (textures are shared).

Released under the MIT License.