1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-02 16:38:41 +00:00

Client: Extend [combine modifier with optional width parameter

This addition makes it possible to combine textures easily without
needing to take care of the texture pack size e.g. by resizing
every texture before combining. This feature automates such labour.
This commit is contained in:
SmallJoker 2024-08-29 23:14:16 +02:00
parent c175046d30
commit f13144a15d
3 changed files with 90 additions and 22 deletions

View file

@ -562,17 +562,22 @@ Example:
default_cobble.png^[crack:10:1
#### `[combine:<w>x<h>:<x1>,<y1>=<file1>:<x2>,<y2>=<file2>:...`
* `<w>`: width
* `<h>`: height
* `<x>`: x position, negative numbers allowed
* `<y>`: y position, negative numbers allowed
* `<file>`: texture to combine
#### `[combine:<w>x<h>:<x1>,<y1>,<w1>=<file1>:<x2>,<y2>,<w2>=<file2>:...`
Creates a texture of size `<w>` times `<h>` and blits the listed files to their
specified coordinates.
Note: the output texture size may vary if one or more of `<wN>` is provided.
The aspect ratio is preserved.
* `<xN>`: X offset of insertion, negative numbers allowed
* `<yN>`: Y offset of insertion, negative numbers allowed
* `<wN>` (optional): Expected texture width
* Scales the output image if `<wN> != input texture width` to perform lossless blit.
* Supported since protocol version 46.
* `<file>`: texture to combine
Example:
[combine:16x32:0,0=default_cobble.png:0,16=default_wood.png