A gameboard widget for pyqt gui's package
Project description
PyQtGameBoard
PyQt5 widget that draws a board on the screen to include in games or map drawing application.
Version
0.2
0.2.2 - Redone building board, zooming in / out and added selection of tile with drawing adjacent tiles
Install
pip install yongshi-pyqtgameboard
Import
from pyqtgameboards.HexagonBoard import QHexagonboard
How to
to try out, copying the following to open a widget with a gameboard This is a gameboard of 20 rows and 10 columns (feels like 20, as it only counts tiles at the same height) This example creates designated tiles that receive a green fill with a thick green line
import sys
from PyQt5 import QtWidgets, QtGui, QtCore
from pyqtgameboards.HexagonBoard import QHexagonboard
if __name__ == '__main__':
overlays = []
overlay1brush = QtGui.QBrush(QtGui.QColor(0,255,0,150))
overlay1pen = QtGui.QPen(QtGui.QColor(0,255,0))
overlay1pen.setWidth(3)
overlay1dict = {
"Brush": overlay1brush,
"Pen": overlay1pen,
"Positions": [
[1, 1],
[2, 1],
[1, 2],
[3, 3],
],
}
overlays.append(overlay1dict)
global app
app = QtWidgets.QApplication(sys.argv)
global main
main = QtWidgets.QMainWindow()
main.setCentralWidget(QHexagonboard(
horizontal = True,
rows = 20,
columns = 10,
overlays = overlays,
))
main.showMaximized()
sys.exit(app.exec_())
Licence
Licensed under GPL-3.0-or-later, see LICENSE file for details.
Copyright © 2020 Michael-Yongshi.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file yongshi-pyqtgameboard-0.2.2.tar.gz
.
File metadata
- Download URL: yongshi-pyqtgameboard-0.2.2.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 122a5e9377196fec9c10b8e0b5aa0499660d2d2ab29508a12fb591398dee0bec |
|
MD5 | 6a3aa372ab8eca3ba554a621a5def69f |
|
BLAKE2b-256 | e8ac829ab0e19a7412ef1d4575885e4d7069465d1d21821460c1a8a409a8eb9d |
File details
Details for the file yongshi_pyqtgameboard-0.2.2-py3-none-any.whl
.
File metadata
- Download URL: yongshi_pyqtgameboard-0.2.2-py3-none-any.whl
- Upload date:
- Size: 18.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a183c39a78083ec4bcd2d6ed0f76a5518f4063e351b4b94d0d478dc838faac2e |
|
MD5 | 7358bcee5056f4240a9c5a4f795947ad |
|
BLAKE2b-256 | f26e9df1010d310d908c21fe08856ee6a94433510f906e4e4a0221cd021d19e9 |