qshader


Nameqshader JSON
Version 1.1.0 PyPI version JSON
download
home_pagehttps://github.com/xzripper/qshader
SummaryQShader - Shaders support for 2D PyQt Games.
upload_time2024-02-16 19:17:15
maintainer
docs_urlNone
authorIvan Perzhinsky.
requires_python
licenseMIT
keywords pyqt qt shaders games 2d
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            📦 QShaderV1-ALPHA. 💫
======================================

Powerful shading support for PyQt5..

.. image:: https://github.com/xzripper/QShader/blob/main/shaders.gif?raw=true
   :align: center

.. code-block:: python

    #thread QTimer 10

    #pre_define hue 0

    #import PyQt5.QtGui QColor

    #begin_shader
    Color1 = QColor.fromHsv(hue, 50, 200)
    Color2 = QColor.fromHsv((hue + 30) % 360, 50, 220)
    Color3 = QColor.fromHsv((hue + 60) % 360, 50, 240)

    if @@UNDER_MOUSE:
        Gradient = f"qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 {Color1.name()}, stop:{@@MOUSE_POSITION_WIDGET.x() / $$parent.width()} {Color2.name()}, stop:1 {Color3.name()})"

    else:
        Gradient = f"qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 {Color1.name()}, stop:0.5 {Color2.name()}, stop:1 {Color3.name()})"

    $$style(f"background: {Gradient}; color: white; border: 0px solid; border-radius: 1px; font-size: 18px; padding: 15px;")

    $$effect(BloomEffect, 100, QColor.fromRgb(Color1.red(), Color2.green(), Color3.blue(), @@RGB_MAX))

    hue = (hue + 1) % 360
    #end_shader

.. code-block:: python

    #thread QTimer 10

    #pre_define hue 0

    #import PyQt5.QtGui QColor

    #begin_shader
    color = QColor.fromHsv(hue, @@RGB_MAX, @@RGB_MAX)

    $$style(f'background-color: {color.name()}; color: black; border: 0px; font-size: 20px; padding: 30px;')

    $$effect(BloomEffect, 250, color)

    $$parent.setText(color.name())

    hue = (hue + (2 if @@UNDER_MOUSE else 1)) % 360
    #end_shader

**WARNING**: QShader is in ALPHA state, please be patient and report all bugs.

`QShader Documentation <https://github.com/xzripper/QShader/blob/main/qshader.md>`__.
`QTS Documentation <https://github.com/xzripper/QShader/blob/main/qtsdocs.md>`__.

----

QShader V1.0.0-ALPHA.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/xzripper/qshader",
    "name": "qshader",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "pyqt,qt,shaders,games,2d",
    "author": "Ivan Perzhinsky.",
    "author_email": "name1not1found.com@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/26/de/e6399c28a6d352ab03c3fef86c730488f8c3ef2ab414964a3951070c4b02/qshader-1.1.0.tar.gz",
    "platform": null,
    "description": "\u0440\u045f\u201c\u00a6 QShaderV1-ALPHA. \u0440\u045f\u2019\u00ab\r\n======================================\r\n\r\nPowerful shading support for PyQt5..\r\n\r\n.. image:: https://github.com/xzripper/QShader/blob/main/shaders.gif?raw=true\r\n   :align: center\r\n\r\n.. code-block:: python\r\n\r\n    #thread QTimer 10\r\n\r\n    #pre_define hue 0\r\n\r\n    #import PyQt5.QtGui QColor\r\n\r\n    #begin_shader\r\n    Color1 = QColor.fromHsv(hue, 50, 200)\r\n    Color2 = QColor.fromHsv((hue + 30) % 360, 50, 220)\r\n    Color3 = QColor.fromHsv((hue + 60) % 360, 50, 240)\r\n\r\n    if @@UNDER_MOUSE:\r\n        Gradient = f\"qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 {Color1.name()}, stop:{@@MOUSE_POSITION_WIDGET.x() / $$parent.width()} {Color2.name()}, stop:1 {Color3.name()})\"\r\n\r\n    else:\r\n        Gradient = f\"qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 {Color1.name()}, stop:0.5 {Color2.name()}, stop:1 {Color3.name()})\"\r\n\r\n    $$style(f\"background: {Gradient}; color: white; border: 0px solid; border-radius: 1px; font-size: 18px; padding: 15px;\")\r\n\r\n    $$effect(BloomEffect, 100, QColor.fromRgb(Color1.red(), Color2.green(), Color3.blue(), @@RGB_MAX))\r\n\r\n    hue = (hue + 1) % 360\r\n    #end_shader\r\n\r\n.. code-block:: python\r\n\r\n    #thread QTimer 10\r\n\r\n    #pre_define hue 0\r\n\r\n    #import PyQt5.QtGui QColor\r\n\r\n    #begin_shader\r\n    color = QColor.fromHsv(hue, @@RGB_MAX, @@RGB_MAX)\r\n\r\n    $$style(f'background-color: {color.name()}; color: black; border: 0px; font-size: 20px; padding: 30px;')\r\n\r\n    $$effect(BloomEffect, 250, color)\r\n\r\n    $$parent.setText(color.name())\r\n\r\n    hue = (hue + (2 if @@UNDER_MOUSE else 1)) % 360\r\n    #end_shader\r\n\r\n**WARNING**: QShader is in ALPHA state, please be patient and report all bugs.\r\n\r\n`QShader Documentation <https://github.com/xzripper/QShader/blob/main/qshader.md>`__.\r\n`QTS Documentation <https://github.com/xzripper/QShader/blob/main/qtsdocs.md>`__.\r\n\r\n----\r\n\r\nQShader V1.0.0-ALPHA.\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "QShader - Shaders support for 2D PyQt Games.",
    "version": "1.1.0",
    "project_urls": {
        "Download": "https://github.com/xzripper/qshader/archive/refs/tags/v1.1.0-alpha.tar.gz",
        "Homepage": "https://github.com/xzripper/qshader"
    },
    "split_keywords": [
        "pyqt",
        "qt",
        "shaders",
        "games",
        "2d"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "26dee6399c28a6d352ab03c3fef86c730488f8c3ef2ab414964a3951070c4b02",
                "md5": "312511080e0b34902bc688dc61f409b7",
                "sha256": "cc77f072a90403bff0a0cf442a4f1329ef28c488cc1a9da25c22442ee6cc5c3b"
            },
            "downloads": -1,
            "filename": "qshader-1.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "312511080e0b34902bc688dc61f409b7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 6848,
            "upload_time": "2024-02-16T19:17:15",
            "upload_time_iso_8601": "2024-02-16T19:17:15.876125Z",
            "url": "https://files.pythonhosted.org/packages/26/de/e6399c28a6d352ab03c3fef86c730488f8c3ef2ab414964a3951070c4b02/qshader-1.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-16 19:17:15",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "xzripper",
    "github_project": "qshader",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "qshader"
}
        
Elapsed time: 0.21325s