Skip to main content

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.

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

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": [
            [0, 0], 
            [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 = [],
        ))

    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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yongshi-pyqtgameboard-0.2.1.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

yongshi_pyqtgameboard-0.2.1-py3-none-any.whl (17.3 kB view details)

Uploaded Python 3

File details

Details for the file yongshi-pyqtgameboard-0.2.1.tar.gz.

File metadata

  • Download URL: yongshi-pyqtgameboard-0.2.1.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.6.8

File hashes

Hashes for yongshi-pyqtgameboard-0.2.1.tar.gz
Algorithm Hash digest
SHA256 ebd75ca58ec268c4dcbb1542980bee37f0a47d469cb4cec4c9d493a97117d4c8
MD5 0b1c8c3612f53b462a2ddafc4d9c24b3
BLAKE2b-256 efd3ba79dd2073962eecbf8abcb84d4e6145564a7b378a6f7d13282edd303972

See more details on using hashes here.

File details

Details for the file yongshi_pyqtgameboard-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: yongshi_pyqtgameboard-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 17.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.6.8

File hashes

Hashes for yongshi_pyqtgameboard-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fe72fa0803981683574621b8b4bc05957ecaf2227ed96effbec752e9d79cc66c
MD5 dc73f9c0a4440a63554e142171773fa6
BLAKE2b-256 762c00ff62d3c54f3e6ca02f1541c26b90fca386b4ac15fe6aa69a3df7c03b76

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page