Skip to content

ColorBorderTexture

Since 2.2.1

ColorBorderTexture draws only a coloured border around a rectangle — no fill. A positive border value draws outside the element bounds; a negative value draws inside.

Registry name: color_border_texture

INFO

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


Usage

java
// 2 px outside border, white
IGuiTexture outline = new ColorBorderTexture(2, 0xFFFFFFFF);

// 1 px inside border, semi-transparent blue
IGuiTexture inset = new ColorBorderTexture(-1, 0x800000FF);

LSS

css
/* border(size, color) */
background: border(2, #FFFFFF);
background: border(-1, #800000FF);

Fields

NameTypeDescription
borderintBorder thickness in pixels. Positive = outside, negative = inside.
colorintPacked ARGB colour.

Methods

MethodReturnsDescription
setBorder(int)ColorBorderTextureSets the border thickness.
setColor(int)ColorBorderTextureSets the packed ARGB colour.
copy()ColorBorderTextureReturns a deep copy.
interpolate(IGuiTexture, float)IGuiTextureBlends border and colour towards another ColorBorderTexture.

Released under the MIT License.