Skip to content

Pyxel Q&A

Takashi Kitao edited this page Jun 12, 2022 · 20 revisions

Downloads GitHub Repo stars GitHub forks GitHub Sponsors

ko-fi

How to Install

Which version should I install, the packaged version or the standalone version?

If you already have Python installed and have used the pip command to install Python packages, then the packaged version is recommended. If you have never installed Python before, I recommend that you start with the standalone version.

Is it possible to import the standalone version as an extension module from Python?

You can do this by setting the environment variable PYTHONPATH to the path output by pyxel module_search_path. If you don't know what this means, I recommend that you uninstall the standalone version and install the packaged version.

How to Migrate to a New Version

What should I change to make my previous Pyxel code compatible with version 1.5+?

Please make the following changes:

  • Rename the caption option of init to title
  • Rename the scale option of init to display_scale
  • Remove the palette option of init. You can modify the palette colors with the colors array after initialization.
  • Remove the fullscreen option of init. You can toggle fullscreen with the fullscreen function after initialization.
  • Rename the key name according to this if an undefined error occurs
  • Rename the get and set of the Image and Tilemap classes to pget and pset, respectively
  • Multiply the u, v, w, and h of bltm by 8. Because bltm can operate in pixel units now.
  • Renamed the members and methods of the Sound and Music classes according to the new names
I can't use the pyxeleditor command in version 1.5+.

From version 1.5, Pyxel's tools are integrated into the pyxel command. You can use the resource editor with pyxel edit [PYXEL_RESOURCE_FILE].

How to Learn Pyxel

Where do I start to learn Pyxel?

I suggest you try to understand it by playing around with Pyxel's example code. Try 01, 05, 03, 04, 02 in that order.

Are there any books on Pyxel?

There are two books in Japanese, though not written by the developer of Pyxel. There is no English version. I'm sure there will be more Pyxel books in the future, including English versions!

How to Distribute Pyxel Apps

Is it possible to convert a Pyxel app into a standalone exe file?

For Windows, you can do it with Nuitka.

First, install required tools:

pip install nuitka zstandard

Then, make an exe file with nuitka command:

nuitka --standalone --onefile --windows-disable-console --include-data-dir=path/to/assets=assets pyxel_app.py

See the Nuitka manual for more details.

API Specifications

What is the difference between the update and draw functions?

Pyxel calls the update function every frame, but the draw function may be skipped if the processing grace time is not sufficient. By doing this, Pyxel achieves smooth animation regardless of the rendering load and interrupt handling.

Future Development Plans

What features do you plan to add to Pyxel in the future?

For now, I am planning to add the following features:

  • Web browser version support
  • Official support for ARM Linux, including Raspberry Pi
  • Additional expandability of tone and number of simultaneous sounds
  • Enhancements to the resource editor, especially the sound editor
  • Python and Pyxel tutorials for kids

Licensing and Sponsorship

Can I use Pyxel for commercial purposes without asking for permission?

Yes, you can use it without the developer's permission, as long as you follow the MIT License and indicate the copyright somewhere. However, I would be grateful if you would consider sponsoring Pyxel!