Canvas

open class Canvas(canvasItem: NovaItem, itemResolution: Int, image: BufferedImage) : Supplier<Item>

An Item supplier for the canvasItem that splits image into square parts of itemResolutionxitemResolution px.

Parameters

canvasItem

The canvas item, which uses a model created via ItemModelCreationScope.canvasModel. This model should be square and should completely fill an entire slot (18x18 px or multiples of that at non-1 scales).

itemResolution

The size of the canvas item in pixels (18 px or multiples of that at non-1 scales).

image

The image that is used to fill the canvas. Will be read from every time notifyWindows is called.

See also

Constructors

Link copied to clipboard
constructor(image: BufferedImage)

Creates a new Canvas with the DefaultGuiItems.CANVAS (18x18 px) item.

constructor(canvasItem: NovaItem, itemResolution: Int, image: BufferedImage)

Functions

Link copied to clipboard
open override fun get(): Item
Link copied to clipboard

Notifies all windows of all items of this canvas.