pgpyui


Namepgpyui JSON
Version 0.1.0 PyPI version JSON
download
home_pagehttps://pypi.org/project/pgpyui/
SummaryThe package is an add-on for Pygame to create a user interface on the screen.
upload_time2024-04-29 08:26:55
maintainerNone
docs_urlNone
authorMemdved
requires_python>=3.6
licenseNone
keywords ui gui pgpyui pygame
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pgpyui 0.1.0

pgpyui is an add-on module for pygame to create a user interface.

## Installation

```
pip install pgpyui
```

## Usage

### Button

Imports
```python
from pgpyui import button
import pygame
```

Creating a button
```python
button = button.Button((100, 100), (200, 100), "Some text", lambda: func(), sprites=["sprites/sprite1.png", "sprites/sprite2.png"])
```

Event handling
```python
button.check_events(event)
```

Drawing
```python
button.draw(window)
```
#
### Text Area

Imports
```python
from pgpyui import textarea
import pygame
```

Creating a text area
```python
textarea = textarea.TextArea((200, 100), (100, 100), 20, 15, is_enter=False, font="Arial")
```

Event handling
```python
textarea.check_events(event)
```

Drawing
```python
textarea.draw(window)
```

Information output
```python
text: list[str] = textarea.data_return()
```

#
### Slider

Imports
```python
from pgpyui import slider
import pygame
```

Creating a slider
```python
slider = slider.Slider((200, 100), (100, 100), 100, orientation="True")
```

Event handling
```python
slider.check_events(event)
```

Drawing
```python
slider.draw(window)
```

Information output
```python
prgrs: int = slider.data_return()
```

#
### CheckBox

Imports
```python
from pgpyui import checkbox
import pygame
```

Creating a checkbox
```python
chkbox = checkbox.CheckBox((100, 100), (50, 50), 3, 75, color=(0, 0, 0), ["passive.png", "active.png"])
```

Event handling
```python
chkbox.check_events(event)
```

Drawing
```python
chkbox.draw(window)
```

Information output
```python
prgrs: list = chkbox.data_return()
```

#
### Radio-button

Imports
```python
from pgpyui import radio
import pygame
```

Creating a radio-button
```python
radiob = radio.Radio((100, 100), 25, 10, 100)
```

Event handling
```python
radiob.check_events(event)
```

Drawing
```python
radiob.draw(window)
```

Information output
```python
rt: list = radiob.data_return()
```

## Documentation

### Button

**Parameters:**

* `position`: The position of the button.
* `size`: The size of the button.
* `text`: The text on the button.
* `function`: The function to be called when the button is clicked.
* `sprite`: A sprite to use for the button (optional).

### TextArea

**Parameters:**

* `position`: The position of the text area.
* `size`: The size of the text area.
* `font_size`: The size of the font.
* `max_symbols`: The maximum number of symbols that can be entered.
* `is_enter`: Whether or not the enter key should be allowed.
* `font`: The name of the font to use (optional).

### Slider

**Parameters:**

* `position`: The position of the slider.
* `size_block`: The size of the block slider.
* `len`: Length of slide.
* `max_symbols`: The maximum number of symbols that can be entered.
* `orientation`: Horisontal or vertical slider. (optional)

### CheckBox

**Parameters:**

* `position`: The position of the CheckBox.
* `size`: The size of the block Checkbox.
* `num_boxes`: The num of CheckBoxes.
* `step`: The distance between the boxes.
* `color`: Color of the box. (optional)
* `sprites`: Two sprites - the first without a check mark, the second with a check mark. (optional)

### Radio-button

**Parameters:**

* `position`: The position of the radio-button.
* `radius`: Radius of radio-button.
* `num_rb`: The num of radio-buttons.
* `step`: The distance between the buttons.
* `color`: Color of the box. (optional)


## License

MIT

## Author mail

mixail.vilyukov@icloud.com

            

Raw data

            {
    "_id": null,
    "home_page": "https://pypi.org/project/pgpyui/",
    "name": "pgpyui",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "ui gui pgpyui pygame",
    "author": "Memdved",
    "author_email": "mixail.vilyukov@icloud.com",
    "download_url": "https://files.pythonhosted.org/packages/7a/22/5cbab39ca1bcc67ebc97ae57a0ad5628ccba23434f61cdabdc73f9aa3b4a/pgpyui-0.1.0.tar.gz",
    "platform": null,
    "description": "# pgpyui 0.1.0\r\n\r\npgpyui is an add-on module for pygame to create a user interface.\r\n\r\n## Installation\r\n\r\n```\r\npip install pgpyui\r\n```\r\n\r\n## Usage\r\n\r\n### Button\r\n\r\nImports\r\n```python\r\nfrom pgpyui import button\r\nimport pygame\r\n```\r\n\r\nCreating a button\r\n```python\r\nbutton = button.Button((100, 100), (200, 100), \"Some text\", lambda: func(), sprites=[\"sprites/sprite1.png\", \"sprites/sprite2.png\"])\r\n```\r\n\r\nEvent handling\r\n```python\r\nbutton.check_events(event)\r\n```\r\n\r\nDrawing\r\n```python\r\nbutton.draw(window)\r\n```\r\n#\r\n### Text Area\r\n\r\nImports\r\n```python\r\nfrom pgpyui import textarea\r\nimport pygame\r\n```\r\n\r\nCreating a text area\r\n```python\r\ntextarea = textarea.TextArea((200, 100), (100, 100), 20, 15, is_enter=False, font=\"Arial\")\r\n```\r\n\r\nEvent handling\r\n```python\r\ntextarea.check_events(event)\r\n```\r\n\r\nDrawing\r\n```python\r\ntextarea.draw(window)\r\n```\r\n\r\nInformation output\r\n```python\r\ntext: list[str] = textarea.data_return()\r\n```\r\n\r\n#\r\n### Slider\r\n\r\nImports\r\n```python\r\nfrom pgpyui import slider\r\nimport pygame\r\n```\r\n\r\nCreating a slider\r\n```python\r\nslider = slider.Slider((200, 100), (100, 100), 100, orientation=\"True\")\r\n```\r\n\r\nEvent handling\r\n```python\r\nslider.check_events(event)\r\n```\r\n\r\nDrawing\r\n```python\r\nslider.draw(window)\r\n```\r\n\r\nInformation output\r\n```python\r\nprgrs: int = slider.data_return()\r\n```\r\n\r\n#\r\n### CheckBox\r\n\r\nImports\r\n```python\r\nfrom pgpyui import checkbox\r\nimport pygame\r\n```\r\n\r\nCreating a checkbox\r\n```python\r\nchkbox = checkbox.CheckBox((100, 100), (50, 50), 3, 75, color=(0, 0, 0), [\"passive.png\", \"active.png\"])\r\n```\r\n\r\nEvent handling\r\n```python\r\nchkbox.check_events(event)\r\n```\r\n\r\nDrawing\r\n```python\r\nchkbox.draw(window)\r\n```\r\n\r\nInformation output\r\n```python\r\nprgrs: list = chkbox.data_return()\r\n```\r\n\r\n#\r\n### Radio-button\r\n\r\nImports\r\n```python\r\nfrom pgpyui import radio\r\nimport pygame\r\n```\r\n\r\nCreating a radio-button\r\n```python\r\nradiob = radio.Radio((100, 100), 25, 10, 100)\r\n```\r\n\r\nEvent handling\r\n```python\r\nradiob.check_events(event)\r\n```\r\n\r\nDrawing\r\n```python\r\nradiob.draw(window)\r\n```\r\n\r\nInformation output\r\n```python\r\nrt: list = radiob.data_return()\r\n```\r\n\r\n## Documentation\r\n\r\n### Button\r\n\r\n**Parameters:**\r\n\r\n* `position`: The position of the button.\r\n* `size`: The size of the button.\r\n* `text`: The text on the button.\r\n* `function`: The function to be called when the button is clicked.\r\n* `sprite`: A sprite to use for the button (optional).\r\n\r\n### TextArea\r\n\r\n**Parameters:**\r\n\r\n* `position`: The position of the text area.\r\n* `size`: The size of the text area.\r\n* `font_size`: The size of the font.\r\n* `max_symbols`: The maximum number of symbols that can be entered.\r\n* `is_enter`: Whether or not the enter key should be allowed.\r\n* `font`: The name of the font to use (optional).\r\n\r\n### Slider\r\n\r\n**Parameters:**\r\n\r\n* `position`: The position of the slider.\r\n* `size_block`: The size of the block slider.\r\n* `len`: Length of slide.\r\n* `max_symbols`: The maximum number of symbols that can be entered.\r\n* `orientation`: Horisontal or vertical slider. (optional)\r\n\r\n### CheckBox\r\n\r\n**Parameters:**\r\n\r\n* `position`: The position of the CheckBox.\r\n* `size`: The size of the block Checkbox.\r\n* `num_boxes`: The num of CheckBoxes.\r\n* `step`: The distance between the boxes.\r\n* `color`: Color of the box. (optional)\r\n* `sprites`: Two sprites - the first without a check mark, the second with a check mark. (optional)\r\n\r\n### Radio-button\r\n\r\n**Parameters:**\r\n\r\n* `position`: The position of the radio-button.\r\n* `radius`: Radius of radio-button.\r\n* `num_rb`: The num of radio-buttons.\r\n* `step`: The distance between the buttons.\r\n* `color`: Color of the box. (optional)\r\n\r\n\r\n## License\r\n\r\nMIT\r\n\r\n## Author mail\r\n\r\nmixail.vilyukov@icloud.com\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "The package is an add-on for Pygame to create a user interface on the screen.",
    "version": "0.1.0",
    "project_urls": {
        "GitHub": "https://github.com/Memdved",
        "Homepage": "https://pypi.org/project/pgpyui/"
    },
    "split_keywords": [
        "ui",
        "gui",
        "pgpyui",
        "pygame"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7a225cbab39ca1bcc67ebc97ae57a0ad5628ccba23434f61cdabdc73f9aa3b4a",
                "md5": "2994e3805dc9acb524cf2b66c5461c1d",
                "sha256": "ea3ec6aebf158829df12681131c33d04459fb76ac708e8d5bab9b71b75bfe81c"
            },
            "downloads": -1,
            "filename": "pgpyui-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "2994e3805dc9acb524cf2b66c5461c1d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 6829,
            "upload_time": "2024-04-29T08:26:55",
            "upload_time_iso_8601": "2024-04-29T08:26:55.520060Z",
            "url": "https://files.pythonhosted.org/packages/7a/22/5cbab39ca1bcc67ebc97ae57a0ad5628ccba23434f61cdabdc73f9aa3b4a/pgpyui-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-29 08:26:55",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "pgpyui"
}
        
Elapsed time: 0.26722s