https://github.com/chriscamacho/mgl-examples
sprites with moderngl
https://github.com/chriscamacho/mgl-examples
Last synced: 3 months ago
JSON representation
sprites with moderngl
- Host: GitHub
- URL: https://github.com/chriscamacho/mgl-examples
- Owner: chriscamacho
- License: mit
- Created: 2024-02-14T19:30:32.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-21T19:10:30.000Z (over 1 year ago)
- Last Synced: 2024-12-28T10:36:19.384Z (5 months ago)
- Language: Python
- Size: 1.87 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# mgl-sprites

These examples are based on the geometry shader example, this reduces it to
one sprite at a time so that individual properties like texture and tint
can be set per sprite. Also used is the rich lines shader.* edit spline example demonstrates screen panning (drag middle mouse button)
and zoom with mouse wheel
* Sprites can be used to drag start, end and control points
* each sprite has its own size, tint and texture
* textures are using a TexutureArray a vertical strip of textures
* sprite example demonstrates mouse dragging, a dragged sprite can be rotated
and sized with mouse wheel and A & Z keys
* script recognises when not run in a virtual environment and self activatesEnjoy!
## Initial set up
(Linux)
```
git clone https://github.com/chriscamacho/mgl-sprites.gitcd mgl-sprites.git
python -m venv venv
. ./venv/bin/activate
pip install -r requirements.txt
./main.py
```
In future you can run the script without activating the virtual
environment as it will self activate.
(Not tested on systemdOS, but presumably it will work)(Windows)
as above but venv activation and pip different
```
./venv/Scritps/activate.ps1python -m pip install -r requirements.txt
```
Depending on terminal used you may need a different script or to change
you execution policyWith the exception of a harmless error message (it doesn't actually
run the correct activate script) on Windows, the self activation is
enough to allow the script to run.