forked from I-am-Erk/CDDA-Tilesets
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
unslice multitile script, tall multitile template (I-am-Erk#365)
- Loading branch information
Showing
6 changed files
with
38 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
.DS_Store | ||
__pycache__ | ||
# generated on build | ||
gfx/*/tile_config.json | ||
|
||
|
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/env python3 | ||
''' | ||
Combine a set of multitile sprites into 4x4 grid | ||
''' | ||
|
||
import argparse | ||
import pyvips | ||
|
||
from slice_autotiles import MAPS | ||
|
||
|
||
def main(args): | ||
multitile_dict = {} | ||
|
||
for suffix, position in MAPS[16].items(): | ||
sprite = pyvips.Image.new_from_file(f'{args.tile}_{suffix}.png') | ||
multitile_dict[position] = sprite | ||
|
||
output_img = pyvips.Image.arrayjoin( | ||
[multitile_dict[i] for i in range(16)], across=4) | ||
output_img.pngsave(f'{args.tile}_multitile.png') | ||
|
||
|
||
if __name__ == '__main__': | ||
parser = argparse.ArgumentParser( | ||
description='Combine a set of multitile sprites') | ||
parser.add_argument('tile', help='base name of the tile') | ||
main(parser.parse_args()) |