Changed syntax and added documentation for texture special command "[sheet".

This commit is contained in:
Luke Puchner-Hardman 2014-09-23 16:20:00 +02:00
parent 56120b2da2
commit da05d94709
3 changed files with 15 additions and 9 deletions

View File

@ -266,6 +266,11 @@ Advanced texture modifiers:
Colorize the textures with given color
<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
-------
Only OGG Vorbis files are supported.

View File

@ -1135,9 +1135,9 @@ minetest.register_node("default:sign_wall", {
minetest.register_node("default:chest", {
description = "Chest",
tiles ={"default_chest.png^[sheet:2:2:0:0", "default_chest.png^[sheet:2:2:0:0",
"default_chest.png^[sheet:2:2:1:0", "default_chest.png^[sheet:2:2:1:0",
"default_chest.png^[sheet:2:2:1:0", "default_chest.png^[sheet:2:2:0:1"},
tiles ={"default_chest.png^[sheet:2x2:0,0", "default_chest.png^[sheet:2x2:0,0",
"default_chest.png^[sheet:2x2:1,0", "default_chest.png^[sheet:2x2:1,0",
"default_chest.png^[sheet:2x2:1,0", "default_chest.png^[sheet:2x2:0,1"},
paramtype2 = "facedir",
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
legacy_facedir_simple = true,
@ -1169,9 +1169,9 @@ end
minetest.register_node("default:chest_locked", {
description = "Locked Chest",
tiles ={"default_chest.png^[sheet:2:2:0:0", "default_chest.png^[sheet:2:2:0:0",
"default_chest.png^[sheet:2:2:1:0", "default_chest.png^[sheet:2:2:1:0",
"default_chest.png^[sheet:2:2:1:0", "default_chest.png^[sheet:2:2:1:1"},
tiles ={"default_chest.png^[sheet:2x2:0,0", "default_chest.png^[sheet:2x2:0,0",
"default_chest.png^[sheet:2x2:1,0", "default_chest.png^[sheet:2x2:1,0",
"default_chest.png^[sheet:2x2:1,0", "default_chest.png^[sheet:2x2:1,1"},
paramtype2 = "facedir",
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
legacy_facedir_simple = true,

View File

@ -1590,6 +1590,7 @@ bool TextureSource::generateImagePart(std::string part_of_name,
}
}
/*
<<<<<<< HEAD
[colorize:color
Overlays image with given color
color = color as ColorString
@ -1626,7 +1627,7 @@ bool TextureSource::generateImagePart(std::string part_of_name,
img->drop();
}
/*
[sheet:W:H:X:Y
[sheet:WxH:X,Y
Retrieves a tile at position X,Y (in tiles)
from the base image it assumes to be a
tilesheet with dimensions W,H (in tiles).
@ -1642,9 +1643,9 @@ bool TextureSource::generateImagePart(std::string part_of_name,
Strfnd sf(part_of_name);
sf.next(":");
u32 w0 = stoi(sf.next(":"));
u32 w0 = stoi(sf.next("x"));
u32 h0 = stoi(sf.next(":"));
u32 x0 = stoi(sf.next(":"));
u32 x0 = stoi(sf.next(","));
u32 y0 = stoi(sf.next(":"));
core::dimension2d<u32> img_dim = baseimg->getDimension();