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

visualizer.py", line 213, in plot_bars self.prev_screen.set_alpha(self.prev_screen.get_alpha()*self.alpha_multiplier) TypeError: unsupported operand type(s) for *: 'NoneType' and 'float' #15

Open
faranaziz opened this issue Jul 18, 2021 · 2 comments

Comments

@faranaziz
Copy link

On windows is get

@Kekspanzer
Copy link

I had the same issue. It seems like a bug from pygame.
My work around was from there(https://stackoverflow.com/questions/21079360/using-surface-copy-sometimes-loses-transparency)

I added .convert_alpha() to the screen.copy() definition. Then it startet working for me

The hole think looks like this now:
if self.plot_audio_history:
self.prev_screen = self.screen.copy().convert_alpha()
self.prev_screen = pygame.transform.rotate(self.prev_screen, 180)
self.prev_screen.set_alpha(self.prev_screen.get_alpha() * self.alpha_multiplier)

@fkjslee
Copy link

fkjslee commented Oct 16, 2021

thank you for your very detailed solution.
it works! @KEKKSTANK

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