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

Post Reply
User avatar
addi
Member
Posts: 664
Joined: Thu Sep 20, 2012 03:16
GitHub: adrido
Location: Black-Forest, Germany

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

by addi » Post

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.

User avatar
Napiophelios
Member
Posts: 1017
Joined: Mon Jul 07, 2014 01:14
GitHub: Napiophelios
IRC: Nappi
In-game: Nappi

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

by Napiophelios » Post

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",
},
Attachments
example.png
(99.26 KiB) Not downloaded yet

User avatar
ExeterDad
Member
Posts: 1717
Joined: Sun Jun 01, 2014 20:00
In-game: ExeterDad
Location: New Hampshire U.S.A

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

by ExeterDad » Post

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.

User avatar
Napiophelios
Member
Posts: 1017
Joined: Mon Jul 07, 2014 01:14
GitHub: Napiophelios
IRC: Nappi
In-game: Nappi

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

by Napiophelios » Post

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 :)

User avatar
prestidigitator
Member
Posts: 640
Joined: Thu Feb 21, 2013 23:54

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

by prestidigitator » Post

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests