Use new font_api columns attribute

This commit is contained in:
Pierre-Yves Rollo 2018-12-04 18:03:34 +01:00
parent 50ecf5be92
commit 06e1318419
3 changed files with 6 additions and 5 deletions

View File

@ -60,7 +60,7 @@ local function push_text(lines, text, maxlines, maxcolumns)
function digimons.push_text_on_screen(pos, text)
local lines = get_lines(pos)
push_text(lines, text, 6, 20)
push_text(lines, text, 6, digimons.columns)
set_lines(pos, lines)
display_api.update_entities(pos)
end

View File

@ -21,6 +21,7 @@
digimons = {}
digimons.name = minetest.get_current_modname()
digimons.path = minetest.get_modpath(digimons.name)
digimons.font = "mozart"
dofile(digimons.path.."/font_mozart.lua")
dofile(digimons.path.."/functions.lua")

View File

@ -97,9 +97,9 @@ digimons.register_monitor('digimons:cathodic_amber_monitor', {
on_display_update = font_api.on_display_update,
depth = -7/16 - display_api.entity_spacing,
top = -1/16,
aspect_ratio = 0.5, maxlines = 6,
size = { x = 23/32, y = 10/16 },
color = "#FFA000", font_name = "mozart", halign="left", valing="top",
columns = 30, maxlines = 6,
color = "#FFA000", font_name = digimons.font, halign="left", valing="top",
},
},
})
@ -130,9 +130,9 @@ digimons.register_monitor('digimons:cathodic_green_monitor', {
on_display_update = font_api.on_display_update,
depth = -7/16 - display_api.entity_spacing,
top = -1/16,
aspect_ratio = 0.5, maxlines = 6,
size = { x = 23/32, y = 10/16 },
color = "#00FF00", font_name = "mozart", halign="left", valing="top",
columns = 30, lines = 6,
color = "#00FF00", font_name = digimons.font, halign="left", valing="top",
},
},
})