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

Transparent parts in the sprite sheet displayed as random color dots instead of transparent? #75

Open
rxing365 opened this issue Feb 14, 2022 · 4 comments
Labels
documentation Improvements or additions to documentation

Comments

@rxing365
Copy link

Hello,

I created a buffer,and emptied it with clear(), then used sprite() to draw the game's map into it, and then used blit() to display the buffer on the screen.
All the opaque parts are good, but the parts that should be transparent are displayed as random color dots. I tried to use clear() on the buffer SCREEN before drawing on it, but it didn't work. Drawing the sprite directly in SCREEN without blit() seems to work correctly, but I really need multiple layers.

I used this web page to convert my PNG image: https://wiki.picosystem.com/en/tools/image-converter

Here is my code and the sprite sheet I used.
main.txt
tileset

Thank you!

@rxing365
Copy link
Author

I did some testing and it seems that using blit() doesn't properly copy the alpha channel of any buffer, not just the sprite. The transparent part shows some random data.

@rxing365
Copy link
Author

rxing365 commented Feb 15, 2022

Problem resolved by assigning a transparent image array to the buffer before using it. I think this issue may be closed. I wish the usage of each functions could be documented in more detail, with examples. I often need to open its header files to see how each function works in order to use them.

@Gadgetoid Gadgetoid added bug Something isn't working documentation Improvements or additions to documentation and removed bug Something isn't working labels Feb 16, 2022
@Gadgetoid Gadgetoid reopened this Feb 16, 2022
@Gadgetoid
Copy link
Member

I'm going to leave this open because:

  1. This darn issue gets me every time, and I still didn't spot that it was the cause of your problem
  2. I agree- we need better documentation for stuff like this, specially the weird edge cases

@ahnlak
Copy link
Contributor

ahnlak commented Sep 12, 2022

I have a feeling this PR partially addresses this issue

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

No branches or pull requests

3 participants