mirror of
https://github.com/minetest-mods/digilines.git
synced 2025-07-05 17:50:39 +02:00
Compare commits
4 Commits
pr_98_fix_
...
master
Author | SHA1 | Date | |
---|---|---|---|
7e005158ac | |||
dd0b66a3df | |||
9354583de5 | |||
e54910c9fe |
4
init.lua
4
init.lua
@ -12,6 +12,10 @@ digilines.mcl = minetest.get_modpath("mcl_core")
|
|||||||
if minetest.get_modpath("default") then digilines.sounds = default end
|
if minetest.get_modpath("default") then digilines.sounds = default end
|
||||||
if digilines.mcl then digilines.sounds = mcl_sounds end
|
if digilines.mcl then digilines.sounds = mcl_sounds end
|
||||||
|
|
||||||
|
-- Show a more helpful error message to the player
|
||||||
|
assert(digilines.sounds,
|
||||||
|
"Digilines requires Minetest Game or a VoxeLibre (-compatible) game.")
|
||||||
|
|
||||||
-- Backwards compatibility code.
|
-- Backwards compatibility code.
|
||||||
-- We define a proxy table whose methods can be called with the
|
-- We define a proxy table whose methods can be called with the
|
||||||
-- `foo:bar` notation, and it will redirect the call to the
|
-- `foo:bar` notation, and it will redirect the call to the
|
||||||
|
6
lcd.lua
6
lcd.lua
@ -162,7 +162,11 @@ local generate_line = function(s, ypos)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local generate_texture = function(lines)
|
local generate_texture = function(lines)
|
||||||
local texture = "[combine:"..LCD_WIDTH.."x"..LCD_WIDTH
|
-- Active Mip Mapping ruins the text due to nearby transparent pixels at a distance.
|
||||||
|
-- Using `lcd_anyside.png` as base image fixes this (see issue #58)
|
||||||
|
local texture = ("lcd_anyside.png^[resize:%dx%d^[combine:%dx%d"):format(
|
||||||
|
LCD_WIDTH, LCD_WIDTH, LCD_WIDTH, LCD_WIDTH
|
||||||
|
)
|
||||||
local ypos = math.floor((LCD_WIDTH - LINE_HEIGHT*NUMBER_OF_LINES) / 2)
|
local ypos = math.floor((LCD_WIDTH - LINE_HEIGHT*NUMBER_OF_LINES) / 2)
|
||||||
for i = 1, #lines do
|
for i = 1, #lines do
|
||||||
texture = texture..generate_line(lines[i], ypos)
|
texture = texture..generate_line(lines[i], ypos)
|
||||||
|
Reference in New Issue
Block a user