Skip to content

API reference Obsidian.API.Client.Screens

GuiImage record

An image from a mod's (or vanilla's) assets, drawn at a widget's size: a GUI sprite, or a region of a whole texture like vanilla's container backgrounds.

public sealed record GuiImage : IEquatable<GuiImage>

In Obsidian.API.Client.

Properties

Identifier

public string Identifier { get; }

The sprite's or texture's identifier.

IsSprite

public bool IsSprite { get; }

Whether it's a GUI sprite rather than a texture region.

U

public int U { get; }

The region's left edge in the texture, in its pixels; 0 for a sprite.

V

public int V { get; }

The region's top edge in the texture, in its pixels; 0 for a sprite.

Methods

Sprite(string)

public static GuiImage Sprite(string identifier);

A GUI sprite, like vanilla's blitSprite: examplemod:machine/arrow for assets/examplemod/textures/gui/sprites/machine/arrow.png, or widget/button for vanilla's. It's stretched, tiled or nine-sliced to the widget's size as its .mcmeta says, like vanilla's.

Texture(string, int, int)

public static GuiImage Texture(string identifier, int u = 0, int v = 0);

A region of a whole texture, like vanilla's blit: examplemod:gui/container/machine for assets/examplemod/textures/gui/container/machine.png, from (u, v) and as big as the widget, in the texture's pixels (vanilla's container textures are 256 by 256).

On this page