Table of Contents

Class ItemstackTextComponent

Namespace
Vintagestory.API.Client
Assembly
VintagestoryAPI.dll

Draws an itemstack

public class ItemstackTextComponent : ItemstackComponentBase
Inheritance
ItemstackTextComponent
Inherited Members

Constructors

ItemstackTextComponent(ICoreClientAPI, ItemStack, double, double, EnumFloat, Action<ItemStack>)

public ItemstackTextComponent(ICoreClientAPI capi, ItemStack itemstack, double size, double rightSidePadding = 0, EnumFloat floatType = EnumFloat.Left, Action<ItemStack> onStackClicked = null)

Parameters

capi ICoreClientAPI
itemstack ItemStack
size double
rightSidePadding double
floatType EnumFloat
onStackClicked Action<ItemStack>

Fields

ShowStacksize

public bool ShowStacksize

Field Value

bool

Methods

CalcBounds(TextFlowPath[], double, double, double, out double)

Initializes the size and stuff. Return true if you had to enter the next line

public override EnumCalcBoundsResult CalcBounds(TextFlowPath[] flowPath, double currentLineHeight, double offsetX, double lineY, out double nextOffsetX)

Parameters

flowPath TextFlowPath[]
currentLineHeight double
offsetX double
lineY double
nextOffsetX double

Returns

EnumCalcBoundsResult

A

ComposeElements(Context, ImageSurface)

Composes the element.

public override void ComposeElements(Context ctx, ImageSurface surface)

Parameters

ctx Context
surface ImageSurface

OnMouseDown(MouseEvent)

public override void OnMouseDown(MouseEvent args)

Parameters

args MouseEvent

RenderInteractiveElements(float, double, double, double)

Renders the text component.

public override void RenderInteractiveElements(float deltaTime, double renderX, double renderY, double renderZ)

Parameters

deltaTime float
renderX double
renderY double
renderZ double