aboutsummaryrefslogtreecommitdiff
path: root/font_lib/API.md
diff options
context:
space:
mode:
authorPierre-Yves Rollo <dev@pyrollo.com>2015-11-28 20:44:04 +0100
committerPierre-Yves Rollo <dev@pyrollo.com>2015-11-28 20:44:04 +0100
commit1b39bf7ae31f0781c65c0a8f9e1d94a37def5f56 (patch)
treeb1ca35fc4238e17eedf782c3b0f631e81d2f7558 /font_lib/API.md
parent9b4513bf9ded0ec759431140b59382fea0bc6009 (diff)
downloaddisplay_modpack-1b39bf7ae31f0781c65c0a8f9e1d94a37def5f56.tar.gz
display_modpack-1b39bf7ae31f0781c65c0a8f9e1d94a37def5f56.tar.bz2
display_modpack-1b39bf7ae31f0781c65c0a8f9e1d94a37def5f56.zip
Added facedir node support to display_lib, created font_lib, updated mods accordingly
Diffstat (limited to 'font_lib/API.md')
-rw-r--r--font_lib/API.md47
1 files changed, 47 insertions, 0 deletions
diff --git a/font_lib/API.md b/font_lib/API.md
new file mode 100644
index 0000000..7ec499b
--- /dev/null
+++ b/font_lib/API.md
@@ -0,0 +1,47 @@
+# Font Lib API
+This document describes Font Lib API. Font Lib creates textures for font display on entities.
+
+## Provided methods
+### get\_line\_width
+**font\_lib.get\_line\_width(text)**
+
+Computes line width for a given font height and text
+**text**: Text to be rendered
+
+**Returns**: rendered text width
+
+### make\_line\_texture
+**font\_lib.make\_line\_texture(text, texturew, x, y)**
+
+Builds texture part for a text line
+
+**text**: Text to be rendered
+
+**texturew**: Width of the texture (extra text is not rendered)
+
+**x**: Starting x position in texture
+
+**y**: Vertical position of the line in texture
+
+**Returns**: Texture string
+
+### make\_multiline\_texture
+**font\_lib.make\_multiline\_texture(text, texturew, textureh, maxlines, valign, color)**
+
+Builds texture for a multiline colored text
+
+**text**: Text to be rendered
+
+**texturew**: Width of the texture (extra text will be truncated)
+
+**textureh**: Height of the texture
+
+**maxlines**: Maximum number of lines
+
+**valign**: Vertical text align ("top" or "center")
+
+**color**: Color of the text
+
+**Returns**: Texture string
+
+