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

User avatar
addi
Member
 
Posts: 605
Joined: Thu Sep 20, 2012 03:16

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

by addi » Sun Mar 22, 2015 12:05

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: 752
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 » Sun Mar 22, 2015 20:44

Wikipedia: bit-boundary block transfer ( maybe??? )

From the Modding API Reference 0.4.11:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
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
example.png (99.26 KiB) Viewed 361 times
 

User avatar
ExeterDad
Member
 
Posts: 1121
Joined: Sun Jun 01, 2014 20:00
In-game: ExeterDad

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

by ExeterDad » Mon Mar 23, 2015 04:06

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.
٩(̾●̮̮̃̾•̃̾)۶

Kibbie and I have a beautiful public server now! HOMETOWN
 

User avatar
Napiophelios
Member
 
Posts: 752
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 » Wed Apr 01, 2015 21:39

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

prestidigitator
Member
 
Posts: 632
Joined: Thu Feb 21, 2013 23:54

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

by prestidigitator » Wed Apr 01, 2015 22:14

The text of the dev wiki texture specification section used to say:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
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.
 


Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 4 guests

cron