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

Screen scaling #10

Open
yohannd1 opened this issue Sep 9, 2020 · 2 comments
Open

Screen scaling #10

yohannd1 opened this issue Sep 9, 2020 · 2 comments

Comments

@yohannd1
Copy link
Collaborator

yohannd1 commented Sep 9, 2020

Currently, the screen size is fixed. Scaling would be a good idea.

@yohannd1
Copy link
Collaborator Author

After a little bit of discussion with @italoseara, we've decided that the scaling type probably should be like this:
image
instead of a "fit inside window" type (the one that usually has black bars on top and bottom). Not sure if it wil go well for extra large screens, but let's try it.

@ExtraMobs
Copy link
Collaborator

I discovered a way to make Camera System, im making in my project 'pgk'.

Basically the Camera object has x, y, size(w, h) and a pygame surface of its size. At the end of the whole frame you draw the camera surface on the screen using 'pygame.transform.scale' and 'destSurf' to optimize (Without 'destSurf', CPU usage is 2x).

you control x, y and size, with a scale, determined as virtual_xy / scale for x, y, and screen_size_wh / scale for screen width and height.

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