diff --git a/doc/lua_api.txt b/doc/lua_api.txt index 131a63fa5..18db3a55f 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -266,6 +266,11 @@ Advanced texture modifiers: Colorize the textures with given color as ColorString + [sheet:x:, + 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. diff --git a/games/minimal/mods/default/init.lua b/games/minimal/mods/default/init.lua index 076f2e6ce..33c863d3f 100644 --- a/games/minimal/mods/default/init.lua +++ b/games/minimal/mods/default/init.lua @@ -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, diff --git a/src/tile.cpp b/src/tile.cpp index 8d5a97f79..03114324e 100644 --- a/src/tile.cpp +++ b/src/tile.cpp @@ -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 img_dim = baseimg->getDimension();