pyxel
pyxel copied to clipboard
load custom palette in editor automatically
Fixes #315 Rework of #321
todo:
- document
- add constant for pyxpal extension
No, asset loading is the role of load function. Editor just use it. So if user call load function, they can expect the same loading mechanism including palette management.
2022年1月12日(水) 12:08 Éric @.***>:
@.**** commented on this pull request.
In pyxel/editor/app.py https://github.com/kitao/pyxel/pull/368#discussion_r782677641:
if os.path.exists(resource_file):
pyxel.load(resource_file)
if os.path.exists(palette_file):
with open(palette_file) as file:
palette = [int(line.lstrip("#"), 16)
for line in file.read().splitlines()]
But the asset loading is there in the Python code! The editor is a Python app, not a Rust one, correct?
— Reply to this email directly, view it on GitHub https://github.com/kitao/pyxel/pull/368#discussion_r782677641, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFFXETID32JEB52QK56NJTUVTWBRANCNFSM5LXZ27FQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you commented.Message ID: @.***>
Ah, I understand.
Do you approve the basic ideas of this PR?
- filename is same as assets -pyxres +pyxpal
- format is text file, 16 lines with
rrggbb
or#rrggbb
Or would it be better to have the palette as a new kind of data inside the assets file, make it editable in the editor somehow, and automatically applied in game?
The specs you mentioned are almost the same as my idea. If the palette is included in the .pyxres, it means Pyxel's editor should support palette editing tool, but It takes too much time only for the small number of users to use the function.
There are still a few things to clarify the design.
- In the first place, for Pyxel, users who use custom palettes are positioned as users who have the skills to implement the functions themselves, so how much can Pyxel complicate the functions for them?
- If there's a user who just would like to use .pyxpal without .pyxres. What kind of solution should be provided?
- If other external settings such as touch panel handling way are required in the future, how to handle them. It can be better that Pyxel support some setting file and palette information is one of the entries
From time to time I get a request to increase the number of colors, but I reject it because it goes against Pyxel's idea of keeping it simple and retro. I think I first need to make everyone understand that custom palettes deviate by half that policy.
It takes too much time only for the small number of users to use the function.
OK, so good reason to not add palette inside pyxres file.
In the first place, for Pyxel, users who use custom palettes are positioned as users who have the skills to implement the functions themselves, so how much can Pyxel complicate the functions for them?
Could you rephrase? I don’t understand this (you want pyxel to make some functions more complicated?)
If there's a user who just would like to use .pyxpal without .pyxres. What kind of solution should be provided?
There’s no use case. If you are not using pyxpal with pyxres, then you are not using the assets editor.
If you have a custom palette for your game and you load images directly, then this PR does not apply, you can already use pyxel.colors.from_list
in your game code.
If other external settings such as touch panel handling way are required in the future, how to handle them. It can be better that Pyxel support some setting file and palette information is one of the entries
I do not know.
[…] Pyxel's idea of keeping it simple and retro. I think I first need to make everyone understand that custom palettes deviate by half that policy.
16 colours is great! But I would say again that we do have support for custom palette in game code, this is just making the assets editor more convenient.
Sorry for my imperfect English skill.
What I would like to say in the first bullet is that I think there are two types of users.
One is programming learner and students, and I'm careful not to over-complicate the functionality, not to increase the amount of manuals, to make it as easy to use as possible for them.
The other is programming-skilled users. For them, I give Pyxel some flexibility, but try not to cover the features they can create by themselves. Because Pyxel is not a professional tool and there are many other game engines for that purpose. That is the Pyxel's basic design policy.
And I think that most of the people who use custom palettes are advanced programmers, so simply adding the necessary functions for that is not suitable for the policy. Therefore, I think it is necessary to think about what functions and flexibility are really necessary for the custom palette, and to think about how to cover it to the minimum, instead of adding it just because Pyxel doesn't have that feature.
I understand your point about keeping Pyxel accessible for novice programmers.
But I feel that you don’t get my point: we can already use an advanced function to change the palette in game, but we can’t change the palette in the assets editor.
No, what would like to say is we should think about what kind of way is suitable for Pyxel carefully.
2022年1月13日(木) 0:20 Éric @.***>:
I understand your point about keeping Pyxel accessible for novice programmers.
But I feel that you don’t get my point: we can already use an advanced function to change the palette in game, but we can’t change the palette in the assets editor.
— Reply to this email directly, view it on GitHub https://github.com/kitao/pyxel/pull/368#issuecomment-1011153268, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFFXEWX4BRQFP5MGYGNNZ3UVWL2ZANCNFSM5LXZ27FQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you commented.Message ID: @.***>
Ah, I understand and fully agree!
I can wait until you have a design that you like. The palette could be inside pyxres, or separate file that’s automatically loaded, or manually loaded, or part of a settings file…
Thank you for your understanding. But you don’t need to wait for my thoughts to settle. Any suggestion is very welcome if it is along with the policy!
2022年1月13日(木) 0:30 Éric @.***>:
Ah, I understand and fully agree!
I can wait until you have a design that you like. The palette could be inside pyxres, or separate file that’s automatically loaded, or manually loaded, or part of a settings file…
— Reply to this email directly, view it on GitHub https://github.com/kitao/pyxel/pull/368#issuecomment-1011163798, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFFXETXMU3D6O4SCYJJJD3UVWM7RANCNFSM5LXZ27FQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you commented.Message ID: @.***>
This PR is one proposal: load palette in editor. You countered: load palette in rust code when loading asset file. Should I (try to) implement your idea?
No, you don't need to implement it (yet at let). Now I'm thinking about what happens if Pyxel has common setting file and it is loaded when Pyxel is initialized and loading resource.
Any update on your thinking for this? 🙂
And I think that most of the people who use custom palettes are advanced programmers
And colorblind people, as I have mentioned in the issue