Metadata-Version: 2.4
Name: pyxel-utils
Version: 0.2.0
Summary: Various utilities for game development with pyxel game engine.
Author: Reiner Gerecke
License: MIT License
        
        Copyright (c) 2024 Reiner Gerecke
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Requires-Python: >=3.10
Provides-Extra: pymunk
Requires-Dist: pymunk; extra == 'pymunk'
Description-Content-Type: text/markdown

# pyxel-utils

![PyPI - Version](https://img.shields.io/pypi/v/pyxel-utils)

Various utilities for game development with the [pyxel](https://github.com/kitao/pyxel) engine.

## Installation

```bash
pip install pyxel-utils
```

## Utilities

### `blt_topleft`

Similar to `pyxel.blt`, but always places the image so that the top-left
corner of the image is at the given x, y position.

Does not support the `rotate` parameter.

### `text_centered`

Draws text horizontally centered at the given x, y position.

### Cursor showing coordinates

Shows the current mouse coordinates under the cursor.

Usage:

```python
import pyxel_utils

def update():
    pyxel_utils.cursor_update()
    ...

def draw():
    ...
    pyxel_utils.cursor_draw()
```

### `point_grid`

Draws a grid of points.

![](examples/grid.png)

Usage:

```python
import pyxel_utils

def draw():
    pyxel_utils.point_grid(10, 10, 3)
```

### `checkerboard`

Draws a checkerboard pattern.

![](examples/checkerboard.png)

Usage:

```python
import pyxel_utils

def draw():
    pyxel_utils.checkerboard(5, 9, 10)
```

### `pymunk` debug draw

![](examples/pymunk.png)

Usage:

```python
from pyxel_utils.pymunk import DrawOptions

...

draw_options = DrawOptions(color=1)

def draw():
    space.debug_draw(draw_options)
```
