Open numberZero opened 7 years ago
Agreed. For now, if you hadn't seen it, the dimensions are 12x5 characters, and there is automatic word-wrapping it seems. (https://github.com/minetest-mods/digilines/blob/master/lcd.lua#L27)
There are other mods which add other lcds, eg.: https://forum.minetest.net/viewtopic.php?t=20794
With #64, you will have the option to use multiple spaces or characters not in the very limited charset (like ´
or ä
) to control the spacing of characters. For left aligned text, this is still just a workaround, but it at least will be possible then.
EDIT: Please note that while you now can use chars like ´
or ä
as spacing, they are encoded as two byte. Lua assumes each character in a string is only one byte long and the typesetting algorithm will thus allocates two spaces for them.
local line_width = 12
local to_display = "fill up!"
local pad_right = function(s, times, char)
char = char or " "
return tostring(s) .. string.rep(char, times)
end
digiline_send('screen', pad_right(to_display, line_width - string.len(to_display)))
This will send fill up!
(with 4 spaces to the right, thank you very much github) to screen
and any LCD set to this channel will display fill up!
all the way to the left.
Center alignment annoys. It is nice for signs, but the LCD should avoid that. Also, the LCD dimensions (in letters) should be documented.