Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release v1.2.1 #25

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions PyTexturePacker/Utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def get_atlas_data_ext(atlas_format):
if len(parameters) >= 2 and required_args <= 2:
return '.txt'

raise ValueError(f"Unsupported file format: {atlas_format}")
raise ValueError("Unsupported file format: %s" % atlas_format)


def save_atlas_data(data_dict, file_path, atlas_format):
Expand All @@ -98,7 +98,7 @@ def save_atlas_data(data_dict, file_path, atlas_format):
if len(parameters) >= 2 and required_args <= 2:
return atlas_format(data_dict, file_path)

raise ValueError(f"Unsupported file format: {atlas_format}")
raise ValueError("Unsupported file format: %s" % atlas_format)


def save_csv(data_dict, file_path):
Expand All @@ -112,9 +112,13 @@ def save_csv(data_dict, file_path):
for name, data in data_dict['frames'].items():
frame = data['frame']
source = data['spriteSourceSize']
fp.write(f'{name},{frame["x"]},{frame["y"]},{frame["w"]},{frame["h"]},'
f'{source["x"]},{source["y"]},{source["w"]},{source["h"]},'
f'{data["rotated"]},{data["trimed"]}\n')

# fp.write(f'{name},{frame["x"]},{frame["y"]},{frame["w"]},{frame["h"]},'
# f'{source["x"]},{source["y"]},{source["w"]},{source["h"]},'
# f'{data["rotated"]},{data["trimed"]}\n')
fp.write('%s,%d,%d,%d,%d,%d,%d,%d,%d,%s,%s\n' % (name, frame["x"], frame["y"], frame["w"], frame["h"],
source["x"], source["y"], source["w"], source["h"],
data["rotated"], data["trimed"]))


def save_json(data_dict, file_path):
Expand Down
Loading