textures.lua 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. -- Node texture tests
  2. local S = minetest.get_translator("testnodes")
  3. minetest.register_node("testnodes:6sides", {
  4. description = S("Six Textures Test Node"),
  5. tiles = {
  6. "testnodes_normal1.png",
  7. "testnodes_normal2.png",
  8. "testnodes_normal3.png",
  9. "testnodes_normal4.png",
  10. "testnodes_normal5.png",
  11. "testnodes_normal6.png",
  12. },
  13. groups = { dig_immediate = 2 },
  14. })
  15. minetest.register_node("testnodes:anim", {
  16. description = S("Animated Test Node"),
  17. tiles = {
  18. { name = "testnodes_anim.png",
  19. animation = {
  20. type = "vertical_frames",
  21. aspect_w = 16,
  22. aspect_h = 16,
  23. length = 4.0,
  24. }, },
  25. },
  26. groups = { dig_immediate = 2 },
  27. })
  28. -- Node texture transparency test
  29. local alphas = { 64, 128, 191 }
  30. for a=1,#alphas do
  31. local alpha = alphas[a]
  32. -- Transparency taken from texture
  33. minetest.register_node("testnodes:alpha_texture_"..alpha, {
  34. description = S("Texture Alpha Test Node (@1)", alpha),
  35. drawtype = "glasslike",
  36. paramtype = "light",
  37. tiles = {
  38. "testnodes_alpha"..alpha..".png",
  39. },
  40. use_texture_alpha = "blend",
  41. groups = { dig_immediate = 3 },
  42. })
  43. -- Transparency set via texture modifier
  44. minetest.register_node("testnodes:alpha_"..alpha, {
  45. description = S("Alpha Test Node (@1)", alpha),
  46. drawtype = "glasslike",
  47. paramtype = "light",
  48. tiles = {
  49. "testnodes_alpha.png^[opacity:" .. alpha,
  50. },
  51. use_texture_alpha = "blend",
  52. groups = { dig_immediate = 3 },
  53. })
  54. end