# pyxel
**Repository Path**: wangbenhao/pyxel
## Basic Information
- **Project Name**: pyxel
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: MIT
- **Default Branch**: main
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2024-07-02
- **Last Updated**: 2024-07-02
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
#
[](https://pypi.org/project/pyxel/)
[](https://github.com/kitao/pyxel)
[](https://github.com/kitao/pyxel)
[](https://github.com/sponsors/kitao)
[](https://ko-fi.com/H2H27VDKD)
[ [English](README.md) | [中文](docs/README.cn.md) | [Deutsch](docs/README.de.md) | [Español](docs/README.es.md) | [Français](docs/README.fr.md) | [Italiano](docs/README.it.md) | [日本語](docs/README.ja.md) | [한국어](docs/README.ko.md) | [Português](docs/README.pt.md) | [Русский](docs/README.ru.md) ]
**Pyxel** is a retro game engine for Python.
Thanks to its simple specifications inspired by retro gaming consoles, such as only 16 colors can be displayed and only 4 sounds can be played back at the same time, you can feel free to enjoy making pixel art style games.
The motivation for the development of Pyxel is the feedback from users. Please give Pyxel a star on GitHub!
## How to Install
### Windows
After installing [Python3](https://www.python.org/) (version 3.7 or higher), run the following command:
```sh
pip install -U pyxel
```
If you install Python using the official installer, please check the `Add Python 3.x to PATH` checkbox to enable `pyxel` command.
### Mac
After installing [Homebrew](https://brew.sh/), run the following commands:
```sh
brew install pipx
pipx ensurepath
pipx install pyxel
```
To update the version after installing Pyxel, run `pipx upgrade pyxel`.
### Linux
After installing the SDL2 package (`libsdl2-dev` for Ubuntu), [Python3](https://www.python.org/) (version 3.7 or higher), and `python3-pip`, run the following command:
```sh
sudo pip3 install -U pyxel
```
If the above doesn't work, try self-building according to the instructions in [Makefile](Makefile).
### Web
The web version of Pyxel does not require Python or Pyxel installation and runs on PCs as well as smartphones and tablets with supported web browsers.
For specific instructions, please refer to [this page](https://github.com/kitao/pyxel/wiki/How-To-Use-Pyxel-Web).
### Try Pyxel Examples
After installing Pyxel, the examples of Pyxel will be copied to the current directory with the following command:
```sh
pyxel copy_examples
```
The examples to be copied are as follows:
| 01_hello_pyxel.py | Simplest application | Demo | Code |
| 02_jump_game.py | Jump game with Pyxel resource file | Demo | Code |
| 03_draw_api.py | Demonstration of drawing APIs | Demo | Code |
| 04_sound_api.py | Demonstration of sound APIs | Demo | Code |
| 05_color_palette.py | Color palette list | Demo | Code |
| 06_click_game.py | Mouse click game | Demo | Code |
| 07_snake.py | Snake game with BGM | Demo | Code |
| 08_triangle_api.py | Demonstration of triangle drawing APIs | Demo | Code |
| 09_shooter.py | Shoot'em up game with screen transition | Demo | Code |
| 10_platformer.py | Side-scrolling platform game with map | Demo | Code |
| 11_offscreen.py | Offscreen rendering with Image class | Demo | Code |
| 12_perlin_noise.py | Perlin noise animation | Demo | Code |
| 13_bitmap_font.py | Drawing a bitmap font | Demo | Code |
| 14_synthesizer.py | Synthesizer utilizing audio expantion features | Demo | Code |
| 15_tiled_map_file.py | Loading and drawing a Tile Map File (.tmx) | Demo | Code |
| 99_flip_animation.py | Animation with flip function (non-web platforms only) | Demo | Code |
| 30SecondsOfDaylight.pyxapp | 1st Pyxel Jam winning game by Adam | Demo | Code |
| megaball.pyxapp | Arcade ball physics game by Adam | Demo | Code |
| 8bit-bgm-gen.pyxapp | Background music generator by frenchbread | Demo | Code |
Drag and drop an image file (PNG/GIF/JPEG) onto the Image Editor to load the image into the currently selected image bank.
**Tilemap Editor**
The mode to edit tilemaps in which images of the image banks are arranged in a tile pattern.
Drag and drop a TMX file (Tiled Map File) onto the Tilemap Editor to load its layer in the drawing order that corresponds to the currently selected tilemap number.
**Sound Editor**
The mode to edit sounds.
**Music Editor**
The mode to edit musics in which the sounds are arranged in order of playback.
### Other Resource Creation Methods
Pyxel images and tilemaps can also be created by the following methods:
- Create an image from a list of strings with `Image.set` function or `Tilemap.set` function
- Load an image file (PNG/GIF/JPEG) in Pyxel palette with `Image.load` function
Pyxel sounds can also be created in the following method:
- Create a sound from strings with `Sound.set` function or `Music.set` function
Please refer to the API reference for usage of these functions.
### How to Distribute Applications
Pyxel supports a dedicated application distribution file format (Pyxel application file) that works across platforms.
Create the Pyxel application file (.pyxapp) with the following command:
```sh
pyxel package APP_DIR STARTUP_SCRIPT_FILE
```
If the application should include resources or additional modules, place them in the application directory.
The created application file can be executed with the following command:
```sh
pyxel play PYXEL_APP_FILE
```
Pyxel application file also can be converted to an executable or an HTML file with the `pyxel app2exe` or `pyxel app2html` commands.
## API Reference
### System
- `width`, `height`
- `bltm(x, y, tm, u, v, w, h, [colkey])`
- `text(x, y, s, col)`