mirror of https://github.com/minetest/minetest.git
Changed syntax and added documentation for texture special command "[sheet".
This commit is contained in:
parent
56120b2da2
commit
da05d94709
|
@ -266,6 +266,11 @@ Advanced texture modifiers:
|
||||||
Colorize the textures with given color
|
Colorize the textures with given color
|
||||||
<color> as ColorString
|
<color> as ColorString
|
||||||
|
|
||||||
|
[sheet:<w>x<h>:<x>,<y>
|
||||||
|
Retrieves a tile at position x,y from the base image
|
||||||
|
which it assumes to be a tilesheet with dimensions w,h.
|
||||||
|
|
||||||
|
|
||||||
Sounds
|
Sounds
|
||||||
-------
|
-------
|
||||||
Only OGG Vorbis files are supported.
|
Only OGG Vorbis files are supported.
|
||||||
|
|
|
@ -1135,9 +1135,9 @@ minetest.register_node("default:sign_wall", {
|
||||||
|
|
||||||
minetest.register_node("default:chest", {
|
minetest.register_node("default:chest", {
|
||||||
description = "Chest",
|
description = "Chest",
|
||||||
tiles ={"default_chest.png^[sheet:2:2:0:0", "default_chest.png^[sheet:2:2:0:0",
|
tiles ={"default_chest.png^[sheet:2x2:0,0", "default_chest.png^[sheet:2x2:0,0",
|
||||||
"default_chest.png^[sheet:2:2:1:0", "default_chest.png^[sheet:2:2:1:0",
|
"default_chest.png^[sheet:2x2:1,0", "default_chest.png^[sheet:2x2:1,0",
|
||||||
"default_chest.png^[sheet:2:2:1:0", "default_chest.png^[sheet:2:2:0:1"},
|
"default_chest.png^[sheet:2x2:1,0", "default_chest.png^[sheet:2x2:0,1"},
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
|
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
|
||||||
legacy_facedir_simple = true,
|
legacy_facedir_simple = true,
|
||||||
|
@ -1169,9 +1169,9 @@ end
|
||||||
|
|
||||||
minetest.register_node("default:chest_locked", {
|
minetest.register_node("default:chest_locked", {
|
||||||
description = "Locked Chest",
|
description = "Locked Chest",
|
||||||
tiles ={"default_chest.png^[sheet:2:2:0:0", "default_chest.png^[sheet:2:2:0:0",
|
tiles ={"default_chest.png^[sheet:2x2:0,0", "default_chest.png^[sheet:2x2:0,0",
|
||||||
"default_chest.png^[sheet:2:2:1:0", "default_chest.png^[sheet:2:2:1:0",
|
"default_chest.png^[sheet:2x2:1,0", "default_chest.png^[sheet:2x2:1,0",
|
||||||
"default_chest.png^[sheet:2:2:1:0", "default_chest.png^[sheet:2:2:1:1"},
|
"default_chest.png^[sheet:2x2:1,0", "default_chest.png^[sheet:2x2:1,1"},
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
|
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
|
||||||
legacy_facedir_simple = true,
|
legacy_facedir_simple = true,
|
||||||
|
|
|
@ -1590,6 +1590,7 @@ bool TextureSource::generateImagePart(std::string part_of_name,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
<<<<<<< HEAD
|
||||||
[colorize:color
|
[colorize:color
|
||||||
Overlays image with given color
|
Overlays image with given color
|
||||||
color = color as ColorString
|
color = color as ColorString
|
||||||
|
@ -1626,7 +1627,7 @@ bool TextureSource::generateImagePart(std::string part_of_name,
|
||||||
img->drop();
|
img->drop();
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
[sheet:W:H:X:Y
|
[sheet:WxH:X,Y
|
||||||
Retrieves a tile at position X,Y (in tiles)
|
Retrieves a tile at position X,Y (in tiles)
|
||||||
from the base image it assumes to be a
|
from the base image it assumes to be a
|
||||||
tilesheet with dimensions W,H (in tiles).
|
tilesheet with dimensions W,H (in tiles).
|
||||||
|
@ -1642,9 +1643,9 @@ bool TextureSource::generateImagePart(std::string part_of_name,
|
||||||
|
|
||||||
Strfnd sf(part_of_name);
|
Strfnd sf(part_of_name);
|
||||||
sf.next(":");
|
sf.next(":");
|
||||||
u32 w0 = stoi(sf.next(":"));
|
u32 w0 = stoi(sf.next("x"));
|
||||||
u32 h0 = stoi(sf.next(":"));
|
u32 h0 = stoi(sf.next(":"));
|
||||||
u32 x0 = stoi(sf.next(":"));
|
u32 x0 = stoi(sf.next(","));
|
||||||
u32 y0 = stoi(sf.next(":"));
|
u32 y0 = stoi(sf.next(":"));
|
||||||
|
|
||||||
core::dimension2d<u32> img_dim = baseimg->getDimension();
|
core::dimension2d<u32> img_dim = baseimg->getDimension();
|
||||||
|
|
Loading…
Reference in New Issue