alphanumeric.lua 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. local letters = {
  2. {'A', 'a'},
  3. {'B', 'b'},
  4. {'C', 'c'},
  5. {'D', 'd'},
  6. {'E', 'e'},
  7. {'F', 'f'},
  8. {'G', 'g'},
  9. {'H', 'h'},
  10. {'I', 'i'},
  11. {'J', 'j'},
  12. {'K', 'k'},
  13. {'L', 'l'},
  14. {'M', 'm'},
  15. {'N', 'n'},
  16. {'O', 'o'},
  17. {'P', 'p'},
  18. {'Q', 'q'},
  19. {'R', 'r'},
  20. {'S', 's'},
  21. {'T', 't'},
  22. {'U', 'u'},
  23. {'V', 'v'},
  24. {'W', 'w'},
  25. {'X', 'x'},
  26. {'Y', 'y'},
  27. {'Z', 'z'}
  28. }
  29. local numbers = {
  30. {'0', '0'},
  31. {'1', '1'},
  32. {'2', '2'},
  33. {'3', '3'},
  34. {'4', '4'},
  35. {'5', '5'},
  36. {'6', '6'},
  37. {'7', '7'},
  38. {'8', '8'},
  39. {'9', '9'}
  40. }
  41. for i in ipairs(letters) do
  42. local desc = letters[i][1]
  43. local name = letters[i][2]
  44. minetest.register_node('decals:'..name, {
  45. description = 'Letter '..desc,
  46. drawtype = 'mesh',
  47. mesh = 'decals_mesh.obj',
  48. tiles = {'decals_'..name..'.png'},
  49. inventory_image = 'decals_'..name..'.png',
  50. wield_image = 'decals_'..name..'.png',
  51. paramtype = 'light',
  52. paramtype2 = 'colorfacedir',
  53. palette = 'decals_color_palette.png',
  54. sunlight_propagates = true,
  55. use_texture_alpha = 'clip',
  56. walkable = false,
  57. selection_box = {
  58. type = 'fixed',
  59. fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
  60. },
  61. collision_box = {
  62. type = 'fixed',
  63. fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
  64. },
  65. groups = {breakable=1},
  66. on_place = minetest.rotate_and_place,
  67. on_rightclick = decals.on_rightclick,
  68. on_punch = decals.on_punch,
  69. })
  70. end
  71. for i in ipairs(numbers) do
  72. local desc = numbers[i][1]
  73. local name = numbers[i][2]
  74. minetest.register_node('decals:'..name, {
  75. description = 'Number '..desc,
  76. drawtype = 'mesh',
  77. mesh = 'decals_mesh.obj',
  78. tiles = {'decals_'..name..'.png'},
  79. inventory_image = 'decals_'..name..'.png',
  80. wield_image = 'decals_'..name..'.png',
  81. paramtype = 'light',
  82. paramtype2 = 'colorfacedir',
  83. palette = 'decals_color_palette.png',
  84. sunlight_propagates = true,
  85. use_texture_alpha = 'clip',
  86. walkable = false,
  87. selection_box = {
  88. type = 'fixed',
  89. fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
  90. },
  91. collision_box = {
  92. type = 'fixed',
  93. fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
  94. },
  95. groups = {breakable=1},
  96. on_place = minetest.rotate_and_place,
  97. on_rightclick = decals.on_rightclick,
  98. on_punch = decals.on_punch,
  99. })
  100. end