kitao / pyxel

A retro game engine for Python
MIT License
15.31k stars 847 forks source link

How to change the window icon in Pyxel. #539

Closed Koroyamie closed 4 months ago

Koroyamie commented 6 months ago

Hello, I'd like to know if it's possible to change the icon in the top left-hand corner of the window, because I've tried to find out, but haven't been able to. Thank you very much for your help. Capture d'écran 2024-05-16 124031

merwok commented 6 months ago

I think there is an advanced function:

Help on built-in function icon in module pyxel.pyxel_wrapper: icon(data, scale, colkey=None)

Koroyamie commented 6 months ago

I see, but the problem is I don't know how to use this function. Do you have any ideas?

kitao commented 6 months ago

As mentioned in the README, you can check all of the Pyxel APIs here:

Advanced APIs

Pyxel has "advanced APIs" that are not mentioned in this reference because they "may confuse users" or "need specialized knowledge to use".

If you are familiar with your skills, try to create amazing works with this as a clue!

And the API is

def icon(data: List[str], scale: int, colkey: Optional[int]) -> None: ...

The format for data is the same as the Image.set method which is used in the example 03.