mirror of
https://github.com/minetest-mods/digilines.git
synced 2025-06-26 21:50:23 +02:00
Improve LCD text readability at a distance
This commit is contained in:
parent
e54910c9fe
commit
9354583de5
6
lcd.lua
6
lcd.lua
@ -162,7 +162,11 @@ local generate_line = function(s, ypos)
|
||||
end
|
||||
|
||||
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)
|
||||
for i = 1, #lines do
|
||||
texture = texture..generate_line(lines[i], ypos)
|
||||
|
Loading…
x
Reference in New Issue
Block a user