]> git.lizzy.rs Git - dragonfireclient.git/blob - games/devtest/mods/testnodes/textures.lua
Merge branch 'master' of https://github.com/minetest/minetest
[dragonfireclient.git] / games / devtest / mods / testnodes / textures.lua
1 -- Node texture tests
2
3 local S = minetest.get_translator("testnodes")
4
5 minetest.register_node("testnodes:6sides", {
6         description = S("Six Textures Test Node"),
7         tiles = {
8                 "testnodes_normal1.png",
9                 "testnodes_normal2.png",
10                 "testnodes_normal3.png",
11                 "testnodes_normal4.png",
12                 "testnodes_normal5.png",
13                 "testnodes_normal6.png",
14         },
15
16         groups = { dig_immediate = 2 },
17 })
18
19 minetest.register_node("testnodes:anim", {
20         description = S("Animated Test Node"),
21         tiles = {
22                 { name = "testnodes_anim.png",
23                 animation = {
24                         type = "vertical_frames",
25                         aspect_w = 16,
26                         aspect_h = 16,
27                         length = 4.0,
28                 }, },
29         },
30
31         groups = { dig_immediate = 2 },
32 })
33
34 -- Node texture transparency test
35
36 local alphas = { 64, 128, 191 }
37
38 for a=1,#alphas do
39         local alpha = alphas[a]
40
41         -- Transparency taken from texture
42         minetest.register_node("testnodes:alpha_texture_"..alpha, {
43                 description = S("Texture Alpha Test Node (@1)", alpha),
44                 drawtype = "glasslike",
45                 paramtype = "light",
46                 tiles = {
47                         "testnodes_alpha"..alpha..".png",
48                 },
49                 use_texture_alpha = "blend",
50
51                 groups = { dig_immediate = 3 },
52         })
53
54         -- Transparency set via texture modifier
55         minetest.register_node("testnodes:alpha_"..alpha, {
56                 description = S("Alpha Test Node (@1)", alpha),
57                 drawtype = "glasslike",
58                 paramtype = "light",
59                 tiles = {
60                         "testnodes_alpha.png^[opacity:" .. alpha,
61                 },
62                 use_texture_alpha = "blend",
63
64                 groups = { dig_immediate = 3 },
65         })
66 end
67