Generate arrow textures

This commit is contained in:
Nils Dagsson Moskopp 2022-05-19 19:05:11 +02:00
parent 94523cbef6
commit 5c7ddf881d
Signed by: erle
GPG Key ID: A3BC671C35191080
4 changed files with 35 additions and 2 deletions

27
generate_textures.lua Normal file
View File

@ -0,0 +1,27 @@
dofile("../tga_encoder/init.lua")
local _ = { 1 }
local K = { 0 }
local W = { 255 }
local pixels = {
{ _, K, K, K, K, K, _ },
{ _, K, W, W, W, K, _ },
{ K, K, W, W, W, K, K },
{ K, W, W, W, W, W, K },
{ _, K, W, W, W, K, _ },
{ _, _, K, W, K, _, _ },
{ _, _, _, K, _, _, _ },
}
tga_encoder.image(pixels):save("textures/maps_arrow.tga")
local pixels = {
{ _, _, _, _, K, _, _ },
{ K, K, _, K, W, K, _ },
{ K, W, K, W, W, W, K },
{ K, W, W, W, W, K, _ },
{ K, W, W, W, K, _, _ },
{ K, W, W, W, W, K, _ },
{ K, K, K, K, K, K, _ },
}
tga_encoder.image(pixels):save("textures/maps_arrow_diagonal.tga")

View File

@ -440,14 +440,20 @@ minetest.register_globalstep(
yaw == 180 or yaw == 180 or
yaw == 270 yaw == 270
) then ) then
marker = "maps_arrow.tga" .. "^[transformR" .. yaw marker = "maps_arrow.tga" ..
"^[makealpha:1,1,1" ..
"^[transformR" ..
yaw
elseif ( elseif (
yaw == 45 or yaw == 45 or
yaw == 135 or yaw == 135 or
yaw == 225 or yaw == 225 or
yaw == 315 yaw == 315
) then ) then
marker = "maps_arrow_diagonal.tga" .. "^[transformR" .. (yaw - 45) marker = "maps_arrow_diagonal.tga" ..
"^[makealpha:1,1,1" ..
"^[transformR" ..
(yaw - 45)
end end
if marker then if marker then
player:hud_change( player:hud_change(

Binary file not shown.

Binary file not shown.