# pgpyui 0.1.2
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", 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
## Documentation site
https://memdved.github.io/pgpyui-doc/index.html
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/6e/25/b7aed737f1e69b48dd7b1aa9d299dedf0f3b08a968805d272d5741abde38/pgpyui-0.1.2.tar.gz",
"platform": null,
"description": "# pgpyui 0.1.2\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\", 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\r\n## Documentation site\r\n\r\nhttps://memdved.github.io/pgpyui-doc/index.html\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.2",
"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": "6e25b7aed737f1e69b48dd7b1aa9d299dedf0f3b08a968805d272d5741abde38",
"md5": "6e8f0967075bd94d0db153a5942a2841",
"sha256": "ac4e28cb09b7a21669b4c9dc623d1620211fddccec4fb2919f0dc8aa93bbf6dc"
},
"downloads": -1,
"filename": "pgpyui-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "6e8f0967075bd94d0db153a5942a2841",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 6739,
"upload_time": "2024-05-29T18:45:24",
"upload_time_iso_8601": "2024-05-29T18:45:24.992660Z",
"url": "https://files.pythonhosted.org/packages/6e/25/b7aed737f1e69b48dd7b1aa9d299dedf0f3b08a968805d272d5741abde38/pgpyui-0.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-29 18:45:24",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "pgpyui"
}