added usage

This commit is contained in:
AspireMint 2018-08-26 15:26:22 +02:00 committed by GitHub
parent 44d9b251f2
commit 27a2985bc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,4 +5,32 @@ Grafitti API for Minetest
Code licensed as GPLv3 (see file LICENSE) 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)
-- }