Skip to main content

A powerful GUI framework for Pygame that allows you to create menus

Project description

Example1

alt text

Brief Description

Nevu UI is a library for the declarative creation of user interfaces in Pygame. The project aims to provide developers with a set of ready-made, stylable, and extensible components for the rapid creation of modern and responsive interfaces in games and multimedia applications.

The main goal of Nevu UI: to make creating interfaces in python even easier and faster

Key features include:

  • Layout system: Convenient arrangement of elements, for example, using grids (Grid) and scrollable containers (Scrollable).
  • Set of widgets: Ready-to-use elements such as buttons, input fields, and labels.
  • Flexible styling: The ability to customize the appearance through a style system that supports colors, gradients, and borders.
  • Animations: Built-in support for animations to create dynamic and lively interfaces.
  • Declarativeness: Support for declarative interface creation

Style

Style - a universal storage of parameters for customizing the appearance

Editable parameters:

  • Gradient
  • ColorTheme - Analogous to MaterialDesign
  • Font name/size
  • Border Width/Radius
  • Text Align X/Y
  • Transparency

Main Features

Nevu UI allows you to describe an interface with a clear structure

Examples of declarativeness:

  • Declarative approach: Describe your interface just as you see it.

    # Specify content directly when creating the layout
    grid = ui.Grid(content={(1,1): ui.Button(...)})
    
  • Adaptive size system (SizeRules): Forget about pixels. Use relative values that adjust to the size of the window or parent element.

    • vh / vw: Percentage of the window's height/width.
    • fill: Percentage of the parent layout's size.
  • Powerful style system: Customize every aspect of the appearance using the universal Style object.

    • Themes: Ready-made color themes (synthwave_dark_color_theme).
    • Gradients: Linear and radial.
    • And much more: Fonts, borders, rounding, transparency.
  • Built-in animations: Bring your interface to life with ready-made animations for appearance, movement, etc.

    widget.animation_manager.add_start_animation(ui.animations.EaseOut(...))
    

Installation

Dependencies:

Python >= 3.12.*

  • For Building:
    • setuptools >= 61.0
    • Cython
    • numpy
  • For Running:
    • pygame-ce>=2.3.0
    • numpy
    • Pillow

Installation via pip

pip install nevu-ui

Examples

Example1

Example2

Пример3


Basic Grid

Declarative Approach

import nevu_ui as ui #Import Nevu UI
import pygame

pygame.init()

class MyGame(ui.Manager): #Create the base of our application
    def __init__(self):
        window = ui.Window((400, 300), title = "My Game") #Create a window
        super().__init__(window) #initialize the manager
        self.menu = ui.Menu(self.window, [100*ui.vw, 100*ui.vh], #Create a menu
                            layout= ui.Grid([100*ui.vw, 100*ui.vh], row=3, column=3, #Create a grid layout
                                            content = {
                                                (2, 2): ui.Button(lambda: print("You clicked!"), "Button", [50*ui.fill,33*ui.fill]) #Create a button
                                            }))
    def draw_loop(self):
        self.menu.draw() #draw the menu
    def update_loop(self, events):
        self.menu.update() #update the menu

game = MyGame()
game.run() #Run the finished application

Imperative Approach

import nevu_ui as ui #Import Nevu UI
import pygame

pygame.init()

window = ui.Window((400, 300), title = "My Game") #Create a window

menu = ui.Menu(window, [100*ui.vw, 100*ui.vh]) #Create a menu

layout = ui.Grid([100*ui.vw, 100*ui.vh], row=3, column=3) #Create a grid layout
layout.add_item(ui.Button(lambda: print("You clicked!"), "Button", [50*ui.fill,33*ui.fill]), x = 2, y = 2) #Create a button

menu.layout = layout #Set the menu layout

while True: #Main loop
    events = pygame.event.get() #Get events
    window.update(events) #Update the window
    menu.update() #Update the menu
    menu.draw() #Draw the menu
    pygame.display.update() #Update the screen

Example Result

Example1

Nevu UI Status at the Moment

Layouts (Layout_Type)

(✅ - done, ❌ - not done, 💾 - deprecated)

  • Grid
  • Row
  • Column
  • ScrollableRow
  • ScrollableColumn
  • 💾 IntPickerGrid
  • Pages
  • 💾 Gallery_Pages
  • StackColumn
  • StackRow
  • CheckBoxGroup

Widgets (Widget)

  • Widget
  • Button
  • Label
  • Input
  • EmptyWidget
  • Tooltip (In 0.6.X)
  • 💾 ImageWidget
  • 💾 GifWidget
  • MusicPlayer (Will be reworked)
  • ProgressBar
  • SliderBar
  • ElementSwitcher
  • 💾 FileDialog
  • RectCheckBox

License

Nevu UI is protected by the MIT license

Additional Information

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

nevu_ui-0.6.5.post3-cp314-cp314t-win_amd64.whl (822.3 kB view details)

Uploaded CPython 3.14tWindows x86-64

nevu_ui-0.6.5.post3-cp314-cp314t-musllinux_1_2_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.14tmusllinux: musl 1.2+ x86-64

nevu_ui-0.6.5.post3-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

nevu_ui-0.6.5.post3-cp314-cp314-win_amd64.whl (788.6 kB view details)

Uploaded CPython 3.14Windows x86-64

nevu_ui-0.6.5.post3-cp314-cp314-musllinux_1_2_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.14musllinux: musl 1.2+ x86-64

nevu_ui-0.6.5.post3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

nevu_ui-0.6.5.post3-cp313-cp313-win_amd64.whl (777.1 kB view details)

Uploaded CPython 3.13Windows x86-64

nevu_ui-0.6.5.post3-cp313-cp313-musllinux_1_2_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

nevu_ui-0.6.5.post3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

nevu_ui-0.6.5.post3-cp312-cp312-win_amd64.whl (779.1 kB view details)

Uploaded CPython 3.12Windows x86-64

nevu_ui-0.6.5.post3-cp312-cp312-musllinux_1_2_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

nevu_ui-0.6.5.post3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

File details

Details for the file nevu_ui-0.6.5.post3-cp314-cp314t-win_amd64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.6.5.post3-cp314-cp314t-win_amd64.whl
Algorithm Hash digest
SHA256 f7ba55e6f38e3f7fd52f5c8e644c5102c339a5d2c4e725523219726c009f6e29
MD5 68e74fb88ba9013d3eb5ccc98b8ea170
BLAKE2b-256 d926e394a63b566f25920dcfd2d2e2261667481f27281ca0410ad667510d7307

See more details on using hashes here.

File details

Details for the file nevu_ui-0.6.5.post3-cp314-cp314t-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.6.5.post3-cp314-cp314t-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 ea4a38509f2c9c214be072eb63ada139ffecaf8ac94d7d5cadee282d4fb690d0
MD5 af5f6296e8e02cdfee8d4b6aabc7ae93
BLAKE2b-256 220aeec60ec7a086f42e9d31aba10ea8517385756bcb449255ecf9fae4971886

See more details on using hashes here.

File details

Details for the file nevu_ui-0.6.5.post3-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.6.5.post3-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2413a78f58ac5c7b4924cc8a87781e2f6b96c858081c26bf298d59cb344ff470
MD5 528e6cff31628447a6791bb772380794
BLAKE2b-256 9ae3482e78e119b0395a32071b82a0ee56e498c7891bd3f2355ab3d19a4ecdfe

See more details on using hashes here.

File details

Details for the file nevu_ui-0.6.5.post3-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.6.5.post3-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 ae2077cf2c4bac88f8ee22c74d163c70d9ea29fa04d310342fc73c42a3e5db20
MD5 579eb4cab594d27b6a908d691d66d34c
BLAKE2b-256 30a5cdd849716a071bac7d9fdf36d10732ee9415c71127fad6f411158f251a95

See more details on using hashes here.

File details

Details for the file nevu_ui-0.6.5.post3-cp314-cp314-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.6.5.post3-cp314-cp314-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 72777e6ee41bd5719c7a8b9a73614a6c169313c3d586102654b075b03b9c6c64
MD5 9974aac260725ed523acd9a34a697244
BLAKE2b-256 2ce5aa347747de5efd4547f43acff9ff6e1f73fd90fc698b6c1b008b79298ca8

See more details on using hashes here.

File details

Details for the file nevu_ui-0.6.5.post3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.6.5.post3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 85b41cbf1198bbc8aa3bb2a3e3a5e1295d7aec072ac973e9c9259f2ccc0cba2a
MD5 6d20bf03790babd48f5b19ade20dfa38
BLAKE2b-256 0eb713a06928aaf0f3e1235790d96e62a4330bcac2e08cb07fa207baee7043cd

See more details on using hashes here.

File details

Details for the file nevu_ui-0.6.5.post3-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.6.5.post3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 a7366d9f4c0544b13a7bbfbb0ee8b9f2583b3eb5c27459e8553fffb958480b9b
MD5 d7112b94f8655ac4dc68072ecfc162c6
BLAKE2b-256 c7ef380bfc2eabf604a12421fff2103cbbcb5e6479f6b31be57542a5e972d7a1

See more details on using hashes here.

File details

Details for the file nevu_ui-0.6.5.post3-cp313-cp313-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.6.5.post3-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 db12039f0b6c0155dd694ac07cff8e4b05a4b5a706cee819e5efd85d980f8153
MD5 79c101a2b1b5efcc491e44d14b10e391
BLAKE2b-256 76849182c44357adc9b79a337ec16b3df93765b78cc1f85872ad538bd071f962

See more details on using hashes here.

File details

Details for the file nevu_ui-0.6.5.post3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.6.5.post3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4b901ec6ca509546b1de3196dc1ae91d1ee4c9ad95d21fee4e6099abd25e2721
MD5 ca62afe261bfd6ef7ee0b41133cca469
BLAKE2b-256 c9f649cb9d9ab3021bf94e81ea9a000647918098b28f09f187cae4e8f26e1ab1

See more details on using hashes here.

File details

Details for the file nevu_ui-0.6.5.post3-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.6.5.post3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 1a41d2d04f97f7500bb39dbc644d6e645fe7bbaadb7561ecccec94a5d7e1ce8c
MD5 e47ba744e6ee5db69dc1fcca346d6171
BLAKE2b-256 4745f559e234f63d8f63646f7a78e54841fdd87a2c447b8d05181234c4345805

See more details on using hashes here.

File details

Details for the file nevu_ui-0.6.5.post3-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.6.5.post3-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 603f9146988105f697a265b3da2cf3709fdeea1db0f74f4c9936abe675e21333
MD5 4935c9b0f551c2e8c5c7b0a9a63d54be
BLAKE2b-256 5836f5befd2403b7e8deee8cb59f9780392b0af91868c2391c2845e92c57a2b4

See more details on using hashes here.

File details

Details for the file nevu_ui-0.6.5.post3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.6.5.post3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 baa91b39e60b5d1406baf193a6228bee9bd9aba1bd37fe2843ad82a3e1bd7683
MD5 16dc9ffc275557341c6aab844e3db4fe
BLAKE2b-256 dae538b2ce6ed00cae4c92c30e482ae8f934565337716ded0128bcc11b6323f9

See more details on using hashes here.

Supported by

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