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

Add logos to standard package data files #2976

Open
MyreMylar opened this issue Jul 7, 2024 · 3 comments
Open

Add logos to standard package data files #2976

MyreMylar opened this issue Jul 7, 2024 · 3 comments

Comments

@MyreMylar
Copy link
Member

MyreMylar commented Jul 7, 2024

From a PR on changing the logos:

Please update:

data_files = files(
'freesansbold.ttf',
'pygame_icon.bmp',
)

data_files = files( 
    'freesansbold.ttf', 
    'pygame_icon.bmp', 
    'pygame_ce_logo.png',
    'pygame_ce_powered.png',
) 

(and include copies of bundled images in src_py/ - likely moving those files to a different folder will be needed in the future), so the code could access these images:

import pygame

pygame.init()
powered_splash = pygame.image.load(pygame.pkgdata.getResource("pygame_ce_powered.png"))

Originally posted by @gresm in #2965 (review)

@MyreMylar
Copy link
Member Author

This would allow users of pygame-ce to easily use the logos in their games - but it would increase the download size of the wheel by the size of the two new PNG files.

@ankith26
Copy link
Member

ankith26 commented Jul 7, 2024

IMO, it is reasonable to not bundle these as "API features" by default. These are high res images that would increase size, and many users may find it undesirable especially if they have usecases like android/wasm/pyinstaller/etc.

It is better for it to be opt-in, where anyone who needs any of the banners/logos can always download it from our docs logos page and bundle it along with their application.

@gresm
Copy link
Contributor

gresm commented Jul 7, 2024

Well, if the wheel size matters, then not every binary has to bundle them and also removing these files from distribution should also be trivial (android/wasm/pyinstaller are quite advanced use-cases and also the default icon and the default font is loaded this way, so for these images it should also work).

What's needed to consider is whether a better API for getting these images is needed (like pygame.pkgdata.get_logo()/pygame.pkgdata.get_splash_image(), which could be literally defined as pygame.image.load(pygame.pkgdata.getResource(...))).
These changes above are bare minimum to make these images available through code.

I also see another benefit of including these images (besides removing the necessity of downloading them form the website) - quick prototyping. It's often useful to have a default image when writing a game to "see things on the screen" (or testing filter effects). Something like Godot which uses its logo as a default image.

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

No branches or pull requests

3 participants