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 python. 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 (ScrollableColumn).
  • 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 - storage of parameters for customizing the appearance

Editable parameters:

  • Gradient
  • ColorTheme - Analogous to MaterialDesign, there is a ready-made set of themes - ColorThemeLibrary
  • 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.
    • fillx / filly / fill: Percentage of the parent layout's height/width/size.
    • gc / gcw / gch: Percentage of the grid cell size.
    • Prefix c: can be placed in any SizeRule, it means that the current value will be taken (without the prefix, the original will be taken).
  • Powerful style system: Customize every aspect of the appearance using the universal Style object.
    • Themes: Ready-made color themes in ColorThemeLibrary.
    • Gradients: Support for linear and radial.
    • Image: Support for a background image via the bgimage parameter.
    • Inheritance: Styles can be created based on existing ones.
    • And much more: Fonts, borders, rounding, transparency.
  • Built-in animations: Bring your interface to life with ready-made animations for movement, transparency, etc.
    • 25+ built-in animations
    • There are 2 types of animations:
      • Start - Allows you to set the initial appearance of the widget.
      • Infinite - Produces an infinite animation defined in animation_manager.
    • Usage example:
      • Start: widget.animation_manager.add_start_animation(ui.animations.EaseOut(...))
      • Infinite: widget.animation_manager.add_continuous_animation(ui.animations.EaseOut(...))

Parameter System (ParamEngine):

  • ParamEngine is a convenient tool built into all layouts and widgets, it allows you to:
    • Declaratively add variables to the object's __init__
    • Check the variable type during initialization and after
    • Integrate a parameter into different stages of initialization
    • Retrieve parameter values via self.get_param(param_name).get()
    • Set parameter values via self.get_param(param_name).set(value)
  • Examples:
    import nevu_ui as ui
    from typing import Unpack, NotRequired
    
    #Create a TypedDict with variables (optional, but looks nice)
    class MyWidgetKwargs(ui.WidgetKwargs):
        my_var: NotRequired[int | float]
    
    class MyWidget(ui.Widget):
        def __init__(self, size: NvVector2 | list, style: Style = default_style, **constant_kwargs: Unpack[MyWidgetKwargs]):
            super().__init__(size, style, **constant_kwargs)
    
        #Override the function to add parameters (mandatory)
        def _add_params(self):
            super()._add_params()
    
            #Add a parameter (mandatory)
            self._add_param('my_var', int | float)
    
            #You can also add a link to a parameter
            #self._add_param_link('my_var', 'my_var_new_name')
    
            #You can also block a parameter if necessary
            #self._block_param('my_var')
    

Installation

Dependencies:

Python >= 3.12.*

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

Installation via pip

pip install nevu-ui

Examples

Example1

Example2

Example3


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):
        super().__init__(ui.Window((400, 300), title = "My Game")) #Initialize the manager
        style = ui.Style(borderradius=20, colortheme=ui.ColorThemeLibrary.material3_dark) #Create Style (optional)
        self.menu = ui.Menu(self.window, [100%ui.vw, 100%ui.vh], style = style, #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, 50%ui.gc], style=style) #Create a button
                                            }
                                            )
                            )
    def on_draw(self):
        self.menu.draw() #draw the menu
    def on_update(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

style = ui.Style(borderradius=20, colortheme=ui.ColorThemeLibrary.material3_dark) #Create Style
menu = ui.Menu(window, [100%ui.vw, 100%ui.vh], style=style) #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, 50%ui.gc], style=style), 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 Heirs)

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

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

Widgets (Widget Heirs)

  • Widget
  • Button
  • Label
  • Input
  • EmptyWidget
  • Tooltip (Pygame exclusive, for now)
  • 💾 Gif
  • MusicPlayer (Will be reworked, hopefully)
  • ProgressBar
  • SliderBar
  • ElementSwitcher
  • 💾 FileDialog
  • RectCheckBox

Available Backends

  • Pygame-ce
  • Pygame-ce._sdl2(Sdl)
  • RayLib (BETA)

Backend Exclusives

  • Ripple effect - Raylib exclusive
  • Transparent colors inside Gradient - Raylib exclusive
  • Customizable center and angle of the gradient - Raylib exclusive
  • Tooltip - Pygame exclusive

License

Nevu UI is protected by the MIT license

Bugs

  • Nevu UI is NOT a stable framework, you may encounter many bugs in it.

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.7.2-cp314-cp314t-win_amd64.whl (1.4 MB view details)

Uploaded CPython 3.14tWindows x86-64

nevu_ui-0.7.2-cp314-cp314t-musllinux_1_2_x86_64.whl (3.7 MB view details)

Uploaded CPython 3.14tmusllinux: musl 1.2+ x86-64

nevu_ui-0.7.2-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (3.7 MB view details)

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

nevu_ui-0.7.2-cp314-cp314-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.14Windows x86-64

nevu_ui-0.7.2-cp314-cp314-musllinux_1_2_x86_64.whl (3.5 MB view details)

Uploaded CPython 3.14musllinux: musl 1.2+ x86-64

nevu_ui-0.7.2-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (3.5 MB view details)

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

nevu_ui-0.7.2-cp313-cp313-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.13Windows x86-64

nevu_ui-0.7.2-cp313-cp313-musllinux_1_2_x86_64.whl (3.5 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

nevu_ui-0.7.2-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (3.5 MB view details)

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

nevu_ui-0.7.2-cp312-cp312-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.12Windows x86-64

nevu_ui-0.7.2-cp312-cp312-musllinux_1_2_x86_64.whl (3.5 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

nevu_ui-0.7.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (3.5 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.7.2-cp314-cp314t-win_amd64.whl.

File metadata

  • Download URL: nevu_ui-0.7.2-cp314-cp314t-win_amd64.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: CPython 3.14t, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for nevu_ui-0.7.2-cp314-cp314t-win_amd64.whl
Algorithm Hash digest
SHA256 a8ec48dc307de68b6bca721722312d1ed578e3703be6029b47b697784b708c2d
MD5 3b56434ecc6273b6078e6c62168b796f
BLAKE2b-256 10bc817c4170fe1e6f5cf8c722cf57e68e708e2e951b1b689f2dd1cf2676037e

See more details on using hashes here.

File details

Details for the file nevu_ui-0.7.2-cp314-cp314t-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.7.2-cp314-cp314t-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 5f11c7af8b8867c6e0de0b45c086b348086613462f02b226b3a47b43af7d24f1
MD5 e89f7f79fbe1a73367cea74b6b64a619
BLAKE2b-256 55670c870d09460782f169499f364eaaa5bb6b4ca2619e8b4f9e9186fbeb7de2

See more details on using hashes here.

File details

Details for the file nevu_ui-0.7.2-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.7.2-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 443527634ff1cb35717a6b4a539edfb362fa80f8b926fbfc127d49a898da39f9
MD5 85a803fd839a08fe07bf139abca76438
BLAKE2b-256 aab5c80b2e8f6b7440254fd31684621440e22b46d850b4490a6f9e4266a65a03

See more details on using hashes here.

File details

Details for the file nevu_ui-0.7.2-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: nevu_ui-0.7.2-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for nevu_ui-0.7.2-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 5cb2087aede0628e8f4bb32063538c2a53cff27a587e4873dee22e15459f570a
MD5 cdcf14b6347c96cf3fe64122264e2697
BLAKE2b-256 4ae2cfea90b72db9fa5c5055c57f1be6ce22a1977ea2f9646b8ea4e10b6c9651

See more details on using hashes here.

File details

Details for the file nevu_ui-0.7.2-cp314-cp314-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.7.2-cp314-cp314-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 a49d43edbfbd4d78cccf750f6a8595d8b723520bf29bae7c1f2534013ee3dff1
MD5 4db44b23c337a5828e82d2d6624e2ff0
BLAKE2b-256 96df79be24a89e01aebe830e6dccb873c2e07c1252fd1ca6a9c37ec439102ca4

See more details on using hashes here.

File details

Details for the file nevu_ui-0.7.2-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.7.2-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b8a3f0682c8a5f49516a9d57af582000d817796226ec23a113938fb6ded8126c
MD5 53fc8ba734b107073d692f5be3d733f8
BLAKE2b-256 9330901d915e734385302fe8d1814e0b6be625d61bc2a404cbe35fcece16ea57

See more details on using hashes here.

File details

Details for the file nevu_ui-0.7.2-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: nevu_ui-0.7.2-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for nevu_ui-0.7.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 be3ce87d8f464d7dce83a7e29a0c2988d738c329689e0e0622df2996ed16e972
MD5 542a2c8d4dc1b72cb1f72bbdf391eb04
BLAKE2b-256 544f45e731e20db7b7eb84022effd6dcd8a5174496f9a658c83e3864cdf7aac9

See more details on using hashes here.

File details

Details for the file nevu_ui-0.7.2-cp313-cp313-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.7.2-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 a2fd8c0055709f6de5a890b7406ea8145a3824459c187e5621613d8ecfd8aa58
MD5 b694e52d506190ba70738708fcc6f911
BLAKE2b-256 a0f45734789e2a638f74699e5835a6e26f2e0d3850771c4743c35597cc91c6ac

See more details on using hashes here.

File details

Details for the file nevu_ui-0.7.2-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.7.2-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 273ff6bbc513297b2dfad3157ff7f7efbffcc378c970a4934f58e6792d8ab324
MD5 8de8a7c3f73379ca52a02a8037a3a879
BLAKE2b-256 dd6b063e96bd71d3c18c4619c8f7e9e8817839a82021857bf85c19fd50824aa9

See more details on using hashes here.

File details

Details for the file nevu_ui-0.7.2-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: nevu_ui-0.7.2-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for nevu_ui-0.7.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 1232fc3fb62f0fb4e7395a1437653ae616ecbc2fb8d04572543264a301c48e43
MD5 fb688d67a32a360081df38910b79266e
BLAKE2b-256 18a6d5f8c849222ffd8ff952ab7cfe58b9c1bd6a619f7c67c4c37212f38568dc

See more details on using hashes here.

File details

Details for the file nevu_ui-0.7.2-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.7.2-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 bdf5e3c03a9b02be345d2aff46c153d80b120c32ac4c73264acddbb586f74d61
MD5 6f24d33d5e0f5238cf29979394ae06ba
BLAKE2b-256 3ad9f1382dfd4b3b50ba759dcb1f5a442c58c6d972c2af6464a67b859ec9aed2

See more details on using hashes here.

File details

Details for the file nevu_ui-0.7.2-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.7.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f843c6fe22351bbe89df11ba52223e1a4fd5239c43a1baa11fd43faf5338d13f
MD5 050c3409e8365380384fb983c50258fa
BLAKE2b-256 2fc74ee18b92e48a31d55acbf557c4ae5b7ba0015dae2a991e5673e919264a3f

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