2020-05-24 15:46:26 +02:00
|
|
|
-- Node texture tests
|
|
|
|
|
|
|
|
local S = minetest.get_translator("testnodes")
|
|
|
|
|
|
|
|
minetest.register_node("testnodes:6sides", {
|
|
|
|
description = S("Six Textures Test Node"),
|
|
|
|
tiles = {
|
|
|
|
"testnodes_normal1.png",
|
|
|
|
"testnodes_normal2.png",
|
|
|
|
"testnodes_normal3.png",
|
|
|
|
"testnodes_normal4.png",
|
|
|
|
"testnodes_normal5.png",
|
|
|
|
"testnodes_normal6.png",
|
|
|
|
},
|
|
|
|
|
|
|
|
groups = { dig_immediate = 2 },
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_node("testnodes:anim", {
|
|
|
|
description = S("Animated Test Node"),
|
|
|
|
tiles = {
|
|
|
|
{ name = "testnodes_anim.png",
|
|
|
|
animation = {
|
|
|
|
type = "vertical_frames",
|
|
|
|
aspect_w = 16,
|
|
|
|
aspect_h = 16,
|
|
|
|
length = 4.0,
|
|
|
|
}, },
|
|
|
|
},
|
|
|
|
|
|
|
|
groups = { dig_immediate = 2 },
|
|
|
|
})
|
|
|
|
|
|
|
|
-- Node texture transparency test
|
|
|
|
|
|
|
|
local alphas = { 64, 128, 191 }
|
|
|
|
|
|
|
|
for a=1,#alphas do
|
|
|
|
local alpha = alphas[a]
|
|
|
|
|
|
|
|
-- Transparency taken from texture
|
|
|
|
minetest.register_node("testnodes:alpha_texture_"..alpha, {
|
|
|
|
description = S("Texture Alpha Test Node (@1)", alpha),
|
|
|
|
drawtype = "glasslike",
|
|
|
|
paramtype = "light",
|
|
|
|
tiles = {
|
|
|
|
"testnodes_alpha"..alpha..".png",
|
|
|
|
},
|
2021-01-17 02:25:33 +01:00
|
|
|
use_texture_alpha = "blend",
|
2020-05-24 15:46:26 +02:00
|
|
|
|
|
|
|
groups = { dig_immediate = 3 },
|
|
|
|
})
|
|
|
|
|
2021-01-16 22:16:04 +01:00
|
|
|
-- Transparency set via texture modifier
|
2020-05-24 15:46:26 +02:00
|
|
|
minetest.register_node("testnodes:alpha_"..alpha, {
|
|
|
|
description = S("Alpha Test Node (@1)", alpha),
|
2021-01-16 22:16:04 +01:00
|
|
|
drawtype = "glasslike",
|
2020-05-24 15:46:26 +02:00
|
|
|
paramtype = "light",
|
|
|
|
tiles = {
|
2021-01-16 22:16:04 +01:00
|
|
|
"testnodes_alpha.png^[opacity:" .. alpha,
|
2020-05-24 15:46:26 +02:00
|
|
|
},
|
2021-01-17 02:25:33 +01:00
|
|
|
use_texture_alpha = "blend",
|
2020-05-30 01:46:57 +02:00
|
|
|
|
2020-05-24 15:46:26 +02:00
|
|
|
groups = { dig_immediate = 3 },
|
|
|
|
})
|
|
|
|
end
|
2020-10-09 20:13:42 +02:00
|
|
|
|