Page 1 of 1

how to use texture [combine:WxH:x1,y1=filename1... correctly

Posted: Sun Mar 22, 2015 12:05
by addi
how do i use [combine:WxH:x1,y1=filename1:x2,y2=filename2:...
correctly?
http://dev.minetest.net/texture only says:
[combine:WxH:x1,y1=filename1:x2,y2=filename2:...
Copies image from file filename1 to x1, y1 of the base image (blitted), filename2 to x2, y2, etc. The base image is created with dimensions W x H if it doesn't exist.
so i have several questions:
whats the base image and how can i define it?
what does mean "blitted"? I cant translate it with Leo or Googel neither its in my dictionary.
can someone provide an example how it works?

my goal is, to get an 8x8 square from possition x,y and copy it to x,y base image.
is that possible with combine?

The finisched mod should provide functions that generates the skin Preview from the skin source.
This could save much textures.

Re: how to use texture [combine:WxH:x1,y1=filename1... corre

Posted: Sun Mar 22, 2015 20:44
by Napiophelios
Wikipedia: bit-boundary block transfer ( maybe??? )

From the Modding API Reference 0.4.11:

Code: Select all

#### `[combine:<w>x<h>:<x1>,<y1>=<file1>:<x2>,<y2>=<file2>`
* `<w>` = width
* `<h>` = height
* `<x1>`/`<x2>` = x positions
* `<y1>`/`<y1>` = y positions
* `<file1>`/`<file2>` = textures to combine

Create a texture of size `<w>` times `<h>` and blit `<file1>` to (`<x1>`,`<y1>`)
and blit `<file2>` to (`<x2>`,`<y2>`).
Example used to kinda recreate Don's Wood corner mod without additional textures :
Image
minetest.register_node("wood_corners:stonebrick", {
description = "Stonebrick with Wood Corner",
tiles = {
"default_stone_brick.png^[transformFXR90",
"default_stone_brick.png^[transformFXR90",
"default_stone_brick.png",
"[combine:32x32:0,0=default_stone_brick.png:20,0=default_wood.png",
"default_stone_brick.png",
"[combine:32x32:0,0=default_wood.png:12,0=default_stone_brick.png",
},

Re: how to use texture [combine:WxH:x1,y1=filename1... corre

Posted: Mon Mar 23, 2015 04:06
by ExeterDad
I wish the modding api existed in it's current state for quick reference... and then a version that contains excellent examples such as this.
Nicely done.

Re: how to use texture [combine:WxH:x1,y1=filename1... corre

Posted: Wed Apr 01, 2015 21:39
by Napiophelios
ExeterDad wrote:I wish the modding api existed in it's current state for quick reference... and then a version that contains excellent examples such as this.
Nicely done.
Download Rubenwardy's modding book, it has a copy of the Modding API Referance in an html format
with a nice little table of contents at the beginning. Just click the subject you want to explore and it takes you there
beats the hell out of Control+F :)

Re: how to use texture [combine:WxH:x1,y1=filename1... corre

Posted: Wed Apr 01, 2015 22:14
by prestidigitator
The text of the dev wiki texture specification section used to say:

Code: Select all

Where an image is required, it may be specified by a simple filename as in "character.png", or it may have a more detailed specification in the form:

   imageComponent1^imageComponent2^...

Where each imageComponentN is either an image filename or a special command. If it is a filename, the image is blitted over the base image to its left—which is the entire sequence up to the current "^" (caret) character—if there is one, or used for further components to its right if it is the first one. A special command begins with the "[" (left square bracket) character and is one of the following:
That might clarify things a bit. Notice in particular the part that says, "...the base image to its left—which is the entire sequence up to the current "^" (caret) character...." The section was then de-clarified along with the modification comment, "copy some stuff from luaapi, which I didn't know yet and force changes here by making the text have partially no sense :¬c}" The emphasized passage I mentioned is still in there, but the context is now very confusing. Not sure what to do about the purposeful de-clarification of the wiki.