Skip to content

API reference Obsidian.API.Client.Razor

ScreenPart class

A building block of a mod's Razor screen, like a Panel, a Label or a SlotGrid: the Razor counterparts of the widgets in Client.Screens, which the client draws with its own widgets, like vanilla's.

public abstract class ScreenPart : ComponentBase

In Obsidian.API.Client.

Remarks

Positions and sizes are in the GUI's pixels, from the top left of the panel the part is in (the screen's, or a Panel's), or offsets in a panel that stacks its parts. The client reads mod objects given to parts, like an ItemGrid's items, and raises their events inside a call into the mod.

Constructors

protected ScreenPart();

Properties

Height

public int? Height { get; set; }

The part's height, in pixels; null for its natural size or its type's default.

Tooltip

public string Tooltip { get; set; }

Text shown in a tooltip while the mouse is over the part, one line per \n, with vanilla's legacy § formatting codes; null for none.

Visible

public bool Visible { get; set; }

Whether the part is drawn and takes input.

Width

public int? Width { get; set; }

The part's width, in pixels; null for its natural size (its text's, its content's) or the default its type says.

X

public int X { get; set; }

Pixels from the left of the panel it's in.

Y

public int Y { get; set; }

Pixels from the top of the panel it's in.

Methods

protected sealed override void BuildRenderTree(RenderTreeBuilder builder);

On this page