Jump to content

Inventory Item Render on a model in world


Recommended Posts

For my "Trade'o'mat" mod I want to display the requested and offered items on top of my model, so players wouldn't need to open the UI to know the price and the offer.

I tried to use IRenderer interface for rendering items in a texture of Quad, just like SignRenderer does. But I cannot find suitable method for this task:

I found that I could use ImageSurface to get the context, render item there, and convert it to texture afterwards, but that thingies requires Cairo lib, and I'm not sure, we're allowed to use it for modding (can we btw?).

Second attempt: I found cApi.Render.RenderItemstackToGui(...), but I cannot use it inside IRenderer::OnRenderFrame (getting NullPointerException).

So, what's the correct way to do it?

  • Like 1
Link to comment
Share on other sites

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.