-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnumbers.lua
96 lines (87 loc) · 2.7 KB
/
numbers.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
-- shape of centred single digit numbers
local node_box_single_centre = {
type = "fixed",
fixed = {
{-3/16, -6/16, -1/16, 3/16, 6/16, 1/16},
},
}
-- shape of right justified single digit numbers
local node_box_single_right = {
type = "fixed",
fixed = {
{1/16, -6/16, 0, 7/16, 6/16, 0},
},
}
-- shape of double digit numbers
local node_box_double = {
type = "fixed",
fixed = {
{-7/16, -6/16, 0, 7/16, 6/16, 0},
},
}
for i = 1,9 do
minetest.register_node("numeracy:number_centre_"..tostring(i), {
description = "Number "..tostring(i).." (centre)",
tiles = {
"numeracy_blank.png",
"numeracy_blank.png",
"numeracy_blank.png",
"numeracy_blank.png",
"numeracy_blank.png^[combine:8x16:4,0=numeracy_number_"..tostring(i)..".png^[transformFX",
"numeracy_blank.png^[combine:8x16:4,0=numeracy_number_"..tostring(i)..".png",
},
use_texture_alpha = 'clip',
groups = { cracky = 2, not_in_creative_inventory = 1 },
drop = "",
pointable = false,
walkable = false,
paramtype = "light",
paramtype2 = "facedir", -- the upper 3 bits represent direction numbers extend
drawtype = "nodebox",
node_box = node_box_single_centre,
})
minetest.register_node("numeracy:number_right_"..tostring(i), {
description = "Number "..tostring(i).." (right)",
tiles = {
"numeracy_blank.png",
"numeracy_blank.png",
"numeracy_blank.png",
"numeracy_blank.png",
"numeracy_blank.png^[combine:8x16:8,0=numeracy_number_"..tostring(i)..".png^[transformFX",
"numeracy_blank.png^[combine:8x16:8,0=numeracy_number_"..tostring(i)..".png",
},
use_texture_alpha = 'clip',
groups = { cracky = 2, not_in_creative_inventory = 1 },
drop = "",
pointable = false,
walkable = false,
paramtype = "light",
paramtype2 = "facedir", -- the upper 3 bits represent direction numbers extend
drawtype = "nodebox",
node_box = node_box_single_right,
})
end
for i = 0,9 do
for j = 0,9 do
minetest.register_node("numeracy:number_"..tostring(i)..tostring(j), {
description = "Number "..tostring(i)..tostring(j),
tiles = {
"numeracy_blank.png",
"numeracy_blank.png",
"numeracy_blank.png",
"numeracy_blank.png",
"numeracy_blank.png^[combine:8x16:0,0=numeracy_number_"..tostring(i)..".png:8,0=numeracy_number_"..tostring(j)..".png^[transformFX",
"numeracy_blank.png^[combine:8x16:0,0=numeracy_number_"..tostring(i)..".png:8,0=numeracy_number_"..tostring(j)..".png",
},
use_texture_alpha = 'clip',
groups = { cracky = 2, not_in_creative_inventory = 1 },
drop = "",
pointable = false,
walkable = false,
paramtype = "light",
paramtype2 = "facedir", -- the upper 3 bits represent direction numbers extend
drawtype = "nodebox",
node_box = node_box_double,
})
end
end