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

convert images for sprite_demo #25

Open
TheLegendOfKitty opened this issue May 27, 2022 · 3 comments
Open

convert images for sprite_demo #25

TheLegendOfKitty opened this issue May 27, 2022 · 3 comments

Comments

@TheLegendOfKitty
Copy link

I've tried multiple combinations with different bgar5515 converters (including the packtiles script) but all of them don't render properly (draws only 1 line, some lines are skipped). I'll provide images if anyone wants them. What is the proper way to convert images?

@lurch
Copy link
Contributor

lurch commented May 27, 2022

Duplicate of #16 ?

@TheLegendOfKitty
Copy link
Author

Seems like OP fixed it, but didn't provide much detail on how. I tried the script he mentioned and did not have any luck.

@zachlindsey
Copy link

zachlindsey commented Oct 2, 2022

Just in case anyone else finds this, here are some tips if you want to use the packfiles script:

  1. Make sure your image is the right size. For sprite_demo, make it 128x128 OR edit the berry[i].log_size = 7 line to be whatever power of 2 you want your images to be.
  2. If your image has transparency, use python packtiles.py -sdmf bgar5515 INPUT.png OUTPUT.h. Note the .h on the output. The flags are important: s makes a single image, and m adds transparency metadata. If your image does NOT have transparency, remove the m flag. d is not so important but makes your image look nice.
  3. If your image does NOT have transparency, you need to change berry[i].has_opacity_metadata = false;. Otherwise, the code will read part of your image as a mask. :)
  4. Edit the produced .h file to have the name you want and edit the imports in the main file.

Good luck!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants