Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/o-murphy/bcrg
Simple lua-based engine to generate dynamic ballistics reticles
https://github.com/o-murphy/bcrg
ballistics framebuf lua luascript python python3 reticles
Last synced: 3 days ago
JSON representation
Simple lua-based engine to generate dynamic ballistics reticles
- Host: GitHub
- URL: https://github.com/o-murphy/bcrg
- Owner: o-murphy
- License: lgpl-3.0
- Created: 2024-05-29T12:54:21.000Z (6 months ago)
- Default Branch: master
- Last Pushed: 2024-11-06T09:49:30.000Z (14 days ago)
- Last Synced: 2024-11-06T10:54:51.302Z (14 days ago)
- Topics: ballistics, framebuf, lua, luascript, python, python3, reticles
- Language: Lua
- Homepage: https://pypi.org/project/bcrg
- Size: 85 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# BCRG - Ballistic reticle generator
### Simple tool to generate dynamic ballistics reticles by .lua templates## Installation
```bash
pip install bcrg
```## Usage
### As CLI tool
```bash
python -m bcrg
usage: bcr [-h] [-o OUTPUT] [-W ] [-H ] [-cx ] [-cy ] [-z [ ...]] [-Z] filepositional arguments:
file Reticle template file in .lua formatoptions:
-h, --help show this help message and exit
-o OUTPUT, --output OUTPUT
Output directory path, defaults to ./
-W , --width
Canvas width (px)
-H , --height
Canvas height (px)
-cx , --click-x
Horizontal click size (cm/100m)
-cy , --click-y
Vertical click size (cm/100m)
-z [ ...], --zoom [ ...]
Zoom value (int)
-Z, --zip Store as .zip```
### As Imported module
```python
from bcrg import LuaReticleLoader
loader = LuaReticleLoader('my_reticle_template.lua')# Create 1bit-depth .bmp bytearray
byte_stream = loader.make_bmp(640, 480, 2.27, 2.27, 4, None)
with open("myreticle.bmp", 'b') as f:
f.write(byte_stream)
```[//]: # (# Create direct bytearray from lua framebuffer )
[//]: # (byte_stream = loader.make_buf(640, 480, 2.27, 2.27, 4, None))
### References
* A reticle template have to implement `make_reticle` function, that gets required arguments and have to return `self:to_bmp` or `self:to_bmp_1bit`
* Examples in ./templates dir