Table of Contents

Delegate ItemRenderDelegate

Namespace
Vintagestory.API.Client
Assembly
VintagestoryAPI.dll

A custom itemstack render handler. This method is called after Collectible.OnBeforeRender(). For render target gui, the gui shader and its uniforms are already fully prepared, you may only call RenderMesh() and ignore the modelMat, position and size values - stack sizes however, are not covered by this.

public delegate void ItemRenderDelegate(ItemSlot inSlot, ItemRenderInfo renderInfo, Matrixf modelMat, double posX, double posY, double posZ, float size, int color, bool rotate = false, bool showStackSize = true)

Parameters

inSlot ItemSlot

The slot in which the itemstack resides in

renderInfo ItemRenderInfo

The render info for this stack, you can choose to ignore these values

modelMat Matrixf

The model transformation matrix with position and size already preapplied, you can choose to ignore this value

posX double

The center x-position where the stack has to be rendered

posY double

The center y-position where the stack has to be rendered

posZ double

The depth position. Higher values might be required for very large models, which can cause them to poke through dialogs in front of them, however

size float

The size of the stack that has to be rendered

color int

The requested color, usually always white

rotate bool

Whether or not to rotate it (some parts of the game have this on or off)

showStackSize bool

Whether or not to show the stack size (some parts of the game have this on or off)