Added display_lib.entity_spacing variable to centralize entity spacing.

This commit is contained in:
Pierre-Yves Rollo 2018-01-18 21:46:10 +01:00
parent a71ae8e013
commit ea36ed50d8
3 changed files with 7 additions and 2 deletions

View File

@ -19,6 +19,11 @@
display_lib = {}
-- Prefered gap between node and entity
-- Entity positionment is up to mods but it is a good practice to use this
-- variable as spacing between entity and node
display_lib.entity_spacing = 0.002
-- Miscelaneous values depending on wallmounted param2
local wallmounted_values = {
[0]={dx=0, dz=0, rx=0, rz=0, yaw=0, rotate=0}, -- Should never be used

View File

@ -158,7 +158,7 @@ function signs.register_sign(mod, name, model)
display_entities = {
["signs:display_text"] = {
on_display_update = font_lib.on_display_update,
depth = 0.499 - model.depth,
depth = 0.5 - display_lib.entity_spacing - model.depth,
size = { x = model.width, y = model.height },
resolution = { x = 64, y = 64 },
maxlines = 1,

View File

@ -59,7 +59,7 @@ for i, material in ipairs(steles.materials) do
display_entities = {
["steles:text"] = {
on_display_update = font_lib.on_display_update,
depth = -2/16-0.001, height = 2/16,
depth = -2/16 - display_lib.entity_spacing, height = 2/16,
size = { x = 14/16, y = 12/16 },
resolution = { x = 11, y = 5 },
maxlines = 3,