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

Activity opens to black canvas #21

Closed
chimosky opened this issue Jul 26, 2023 · 6 comments · Fixed by #24
Closed

Activity opens to black canvas #21

chimosky opened this issue Jul 26, 2023 · 6 comments · Fixed by #24

Comments

@chimosky
Copy link
Member

Activity currently opens to a black canvas.

@jriyyya
Copy link

jriyyya commented Sep 4, 2023

I was never able to reproduce it, Tried with starting it through ring as well.

@Dimi20cen @sourabhaa Can you please check if you can reproduce it.

@Dimi20cen
Copy link

It opens normally for me, tested on sugar live-build, pygame 1.9.4.post1.

@chimosky
Copy link
Member Author

chimosky commented Sep 6, 2023

I'm running pygame 2.5.0 and this is what happens;

Screencast.from.2023-09-06.13-44-59.webm

Haven't taken a close look though.

@Dimi20cen
Copy link

I've update to pygame 2.4.0 and the issue of black canvas is present. @jriyyya, I would suggest updating to a newer version of pygame to be able to reproduce the issue.

Removing

if event.type == pygame.VIDEORESIZE:
    pygame.display.set_mode(event.size, pygame.RESIZABLE)

from the while True: loop inside the run method of class BallAndBrick in #20 and i nthe code of the master branch, fixes the black canvas, but might introduce other issues.

@chimosky
Copy link
Member Author

I've update to pygame 2.4.0 and the issue of black canvas is present. @jriyyya, I would suggest updating to a newer version of pygame to be able to reproduce the issue.

Removing

if event.type == pygame.VIDEORESIZE:
    pygame.display.set_mode(event.size, pygame.RESIZABLE)

from the while True: loop inside the run method of class BallAndBrick in #20 and i nthe code of the master branch, fixes the black canvas, but might introduce other issues.

Seems we'll need to reconsider our use of VIDEORESIZE according to pygame, could you test your fix and see if any thing is affected and open a PR. Thanks!

@Dimi20cen
Copy link

From what I understand those lines are not doing anything. Hopefully I dont miss something. Openned PR #22

vaibhav-sangwan added a commit to vaibhav-sangwan/ball-and-brick-activity that referenced this issue Apr 13, 2024
VIDEORESIZE event is triggered on activity startup, which is handled by calling pygame.display.set_mode(). This returns an empty Surface object completely discarding the previous state of screen.

* Call draw functions after resizing to populate the newly returned empty surface with game elements,

* Initialize pygame mixer.
chimosky pushed a commit that referenced this issue Apr 23, 2024
VIDEORESIZE event is triggered on activity startup, which is handled by calling pygame.display.set_mode(). This returns an empty Surface object completely discarding the previous state of screen.

* Call draw functions after resizing to populate the newly returned empty surface with game elements,

* Initialize pygame mixer.
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

Successfully merging a pull request may close this issue.

3 participants