index
:
advtrains.git
atcjit
doc
l10n
luaatcdebug
master
profiler
timetable
tracy
trainhud
trainhud-unifont
Advtrains mod for minetest.
orwell
about
summary
refs
log
tree
commit
diff
log msg
author
committer
range
path:
root
/
advtrains
/
trainlogic.lua
diff options
context:
1
2
3
4
5
6
7
8
9
10
15
20
25
30
35
40
space:
include
ignore
mode:
unified
ssdiff
stat only
author
orwell <orwell@bleipb.de>
2025-01-28 22:24:03 +0100
committer
orwell <orwell@bleipb.de>
2025-01-28 22:24:03 +0100
commit
a212310913c33fb855ca0f262beda6d857382ff8
(
patch.
setup
(
1680
,
945
)
json
=
require
(
"json"
)
font
=
resource
.
load_font
(
"light.ttf"
)
font2
=
resource
.
load_font
(
"light.ttf"
)
background
=
resource
.
load_image
(
"whitepixel.png"
)
maxCharWidth
=
WIDTH
/
0.6
color
= {
r
=
0.95
,
g
=
0.95
,
b
=
0.0
}
charSize
=
82
function
alignRight
(
num
)
-- 0 1 2 3 4 5 6 7 8 9
local
width
= {
5
,
30
,
7
,
5
,
7
,
15
,
8
,
5
,
5
,
5
}
local
num1
=
num
%
10
;
local
num2
=
math
.
floor
(
num
/
10
%
10
);
if
num2
>=
1
then
return
width
[
num1
+
1
] +
width
[
num2
+
1
]
else
return
width
[
num1
+
1
] +
44
end
end
function
node
.
render
()
local
i
=
0
local
station_json
=
json
.