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.post4-cp314-cp314t-win_amd64.whl (822.2 kB view details)

Uploaded CPython 3.14tWindows x86-64

nevu_ui-0.6.5.post4-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.post4-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.post4-cp314-cp314-win_amd64.whl (788.6 kB view details)

Uploaded CPython 3.14Windows x86-64

nevu_ui-0.6.5.post4-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.post4-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.post4-cp313-cp313-win_amd64.whl (777.1 kB view details)

Uploaded CPython 3.13Windows x86-64

nevu_ui-0.6.5.post4-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.post4-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.post4-cp312-cp312-win_amd64.whl (779.1 kB view details)

Uploaded CPython 3.12Windows x86-64

nevu_ui-0.6.5.post4-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.post4-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.post4-cp314-cp314t-win_amd64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.6.5.post4-cp314-cp314t-win_amd64.whl
Algorithm Hash digest
SHA256 40aadc2645635b885216e1ace32f4c2dc97c5f1aa6a0ee0e2fd968b22eeb43b2
MD5 0c3970c1ce765fab7487df7ecc822d77
BLAKE2b-256 33fb4149cb7c8dff137cf8db4251e4dd8d65e167d3ff171196a0da4f5cd96f03

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.6.5.post4-cp314-cp314t-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 9c877f790849f29921f8618f58c9169bb0bc0ee688f7effa955ca9c361aef982
MD5 a7d73babb8e6626d8f9b9d088e645e3d
BLAKE2b-256 21eb5080554c6f97c03b2c2170438f2ba313945365bc931b6bcfbf6cc8cafb07

See more details on using hashes here.

File details

Details for the file nevu_ui-0.6.5.post4-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.post4-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 fbfa8da516bca6d8af0df04cfe5c9dc0c79c2cd43cee9d78115541cb4125fc59
MD5 f14aedf5a2caba569137f8ebd4790804
BLAKE2b-256 8ce98e20c8201b19f0f687075dbc9d15949c9abe13159681fa3158417ead7c25

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.6.5.post4-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 efa2f7081a03ce2da0d9653e80346f370633d5fdbab0c16689eeb09d17d02315
MD5 8184a4d3e0181e8c62eb8355edeec48f
BLAKE2b-256 9466c7c78c0c414b1baa9220bbb3ad07e6ffcc06d2bfd8939709e322268660bb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.6.5.post4-cp314-cp314-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 888da0ef7eb1a56d3cef7140a8de104721704b04dd3f035809256be3dbae80a6
MD5 f840c9e89767ae163b330fe8d9fcad77
BLAKE2b-256 54a5588996674b568af66272ebb7539e1fd828d54e299bf0aff2289fb110ea35

See more details on using hashes here.

File details

Details for the file nevu_ui-0.6.5.post4-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.post4-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f974f79b3660418965af7e86efe83191031cb4f9c559381bc473d5d02ff74804
MD5 a8f3273be4854b613a62c03c689d9af7
BLAKE2b-256 82311f77df1d749d95b7355d8867f49fc0acf49fcf50af6e464e614fc636aba2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.6.5.post4-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 1b0bb64aa1348389f8332a74c34ebda806ddfd65da26c25b06f2edf3fe17bd9a
MD5 f2fdb381c5f6af3ff1e3bcae2e7a6b4b
BLAKE2b-256 c98ff8660f10fd5e8c32b85393a82f5bdcfd0e9bf20f2cafde95ac5713961d7f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.6.5.post4-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 1c04fd08d49a6e72c7f57d4fdca28c6b354e64ca1f66c2c5cf3680cbf388aa15
MD5 138ed3be13c9d36e70433b57a6816935
BLAKE2b-256 943916f8ade5cd4a6c792ec2adc3e846e11379178f22f4137b343fbccbe6af7c

See more details on using hashes here.

File details

Details for the file nevu_ui-0.6.5.post4-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.post4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e1e91caa0a765b45ac7204e493d475d9d0b9b1cad360cf74003ab107f8338bff
MD5 b12f7cf5e2303c6919228506cc1970ae
BLAKE2b-256 de0edc75dd1b02f7b03f5dcfa4e9869ccc4cd8e0b93940fcbd09e43015732271

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.6.5.post4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 e51239cbed4ae1d4a19e22820a855a551499714a6b85df200d9283dc68e8e785
MD5 8995be78df1ef7e9c0174ed581950524
BLAKE2b-256 5624d838698eb1c96c63b1028de69bf226387995dde80b10de46a677e9cda7e7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.6.5.post4-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 cd805921a3c443eca5975a5a2ae96ed46e4ae02ecd77b5cb635366865de0eb88
MD5 2833b6290cb437b7ad82c06ffddc40a1
BLAKE2b-256 5e050bf50cdb1e52bf34107cf46f9e1edb099045a32453fe6bfa3c8b4360fe4c

See more details on using hashes here.

File details

Details for the file nevu_ui-0.6.5.post4-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.post4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 fd6e2f90c7b5104e0d126d7ab7161755c04830905538ad88bb72ea9427d1c91f
MD5 ae40fc98c14d342d5f250ade9b9f00cb
BLAKE2b-256 ddf0efa1eb4be0069a65ba4db2a75eb7f6076645b2762fc93f41b6c45107af1b

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