From 27a2985bc88ff2b2d1b9eef4512969ba20112475 Mon Sep 17 00:00:00 2001 From: AspireMint <37676291+AspireMint@users.noreply.github.com> Date: Sun, 26 Aug 2018 15:26:22 +0200 Subject: [PATCH] added usage --- README.md | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c4f7525..bb1ed52 100644 --- a/README.md +++ b/README.md @@ -5,4 +5,32 @@ Grafitti API for Minetest Code licensed as GPLv3 (see file LICENSE) -Screenshot: +Usage: + +grafitti.register_grafitti(node_name, def) +-- node_name (eg. "default:stone") +-- def : { +-- image, +-- size = {x, y}, (optional, default: {1, 1}) +-- center = {row, col}, (optional, default: {0, 0}) +-- pointable (optional, default: false) +-- } + +grafitti.set_palette_width(width) +-- Set GUI width for palette. If not set, default width is 8. +-- Use before palette build. + +grafitti.palette_build(palette_name) +-- Place all previously registered grafitti into palette. +-- palette_name (eg. "mymod:nyancat_images") + +grafitti.register_brush(brush_name, def) +-- Use after palette_build. +-- brush_name (eg. "mymod:nyancat_brush") +-- def : { +-- palette (eg. "mymod:nyancat_images"), +-- description (optional), +-- inventory_image (optional), +-- wield_image (optional), +-- recipe (optional) +-- }