aboutsummaryrefslogtreecommitdiff
path: root/advtrains/trainlogic.lua
diff options
context:
space:
mode:
authororwell <orwell@bleipb.de>2025-01-28 22:24:03 +0100
committerorwell <orwell@bleipb.de>2025-01-28 22:24:03 +0100
commita212310913c33fb855ca0f262beda6d857382ff8 (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.