Skip to main content

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

Project description

Краткое описание

Nevu UI — это библиотека для декларативного создания пользовательских интерфейсов на Pygame. Проект нацелен на предоставление разработчикам набора готовых, стилизуемых и расширяемых компонентов для быстрого создания современных и отзывчивых интерфейсов в игровых и мультимедийных приложениях.

Главная цель Nevu UI: сделать создание интерфейсов на python еще легче и быстрее

Ключевые особенности включают:

  • Система макетов: Удобное расположение элементов с помощью сеток (Grid) и прокручиваемых контейнеров (Scrollable).
  • Набор виджетов: Готовые к использованию элементы, такие как кнопки, поля ввода и метки.
  • Гибкая стилизация: Возможность кастомизации внешнего вида через систему стилей, поддерживающую цвета, градиенты и рамки.
  • Анимации: Встроенная поддержка анимаций для создания динамичных и живых интерфейсов.
  • Декларативность: Поддержка декларативного создания интерфейса

Стиль

Style - универсальное хранилище параметров для кастомизации внешнего вида

Изменяемые параметры:

  • Gradient
  • ColorTheme - Аналог MaterialDesign
  • Font name/size
  • Border Width/Radius
  • Text Align X/Y
  • Transparency

Главные особенности

Nevu UI позволяет описивать инферфейс с видной структурой

Примеры декларативности:

  • Декларативный подход: Описывайте ваш интерфейс так же, как вы его видите.

    # Указывайте контент прямо при создании макета
    grid = ui.Grid(content={(1,1): ui.Button(...)})
    
  • Адаптивная система размеров (SizeRules): Забудьте о пикселях. Используйте относительные величины, которые подстраиваются под размер окна или родительского элемента.

    • vh / vw: Проценты от высоты/ширины окна.
    • fill: Проценты от размера родительского макета.
  • Мощная система стилей: Настраивайте каждый аспект внешнего вида с помощью универсального объекта Style.

    • Темы: Готовые цветовые темы (synthwave_dark_color_theme).
    • Градиенты: Линейные и радиальные.
    • И многое другое: Шрифты, рамки, скругления, прозрачность.
  • Встроенные анимации: Оживите ваш интерфейс с помощью готовых анимаций появления, движения и т.д.

    widget.animation_manager.add_start_animation(ui.AnimationEaseOut(...))
    

Установка

Зависимости:

Python >= 3.12.*

  • Для Сборки:
    • setuptools >= 61.0
    • Cython
    • numpy
  • Для Запуска:
    • pygame-ce>=2.3.0
    • numpy
    • Pillow

Установка через pip

pip install nevu-ui

Примеры

Пример1

Пример2


Продвинутая сетка

import nevu_ui as ui
import pygame
pygame.init()

class Mygame(ui.Manager):
    def __init__(self):
        super().__init__()
        self.fps = 75 #Задаем нуженый fps
        self.background = (0,0,100) #Цвет фона
        self.window = ui.window.Window((300,300), resize_type=ui.ResizeType.FillAllScreen) #Создаем окно
        main_style = ui.Style( #Гланый стиль
            borderradius=10, borderwidth=2, colortheme=ui.synthwave_dark_color_theme,
            fontname="vk_font.ttf", gradient=ui.style.Gradient(colors=[ui.Color.AQUA,(100,100,100)],type='radial',direction=ui.style.Gradient.TOP_CENTER))
        style_mini_font = main_style( #Подстиль
            fontsize=15, border_radius=15,  
            borderwidth=10, gradient=ui.style.Gradient(colors=[ui.Color.REBECCAPURPLE,ui.Color.mix(ui.Color.AQUA,ui.Color.REBECCAPURPLE)],type='linear',direction=ui.style.Gradient.TO_TOP))
    
        b = ui.Button(lambda: print("Button 1"), "Test Chamber", [100*ui.fill,33*ui.fill], style=style_mini_font(borderradius=15, borderwidth=10), words_indent=True, alt=True) #Создаем кнопку
        i = ui.Input([100*ui.fill,33*ui.fill],style_mini_font(borderradius=30,fontname="vk_font.ttf"),"","Введите",multiple=True, alt=True) #Создаем инпут
        
        i.animation_manager.add_start_animation(ui.AnimationEaseOut(3,[0,-100],[0,0],ui.AnimationType.POSITION)) #Добавляем анимацию в начало
        
        #создаем макет
        gridmenu = ui.Grid([66*ui.fill, 40*ui.fill], x=3,y=3, 
                                content={
                                        (2,1): b,
                                        (2,2): i
                                    }
                         )
        
        self.menu = ui.menu.Menu(self.window,(100*ui.vw,100*ui.vh),
                style = main_style(borderradius=20,borderwidth=1), alt=False, 
                layout = ui.Grid([100*ui.fill,100*ui.fill],x=3,y=3, 
                         content = {
                         (2,1.2): gridmenu,
                         (2,2.1): gridmenu, #Внимание: Grid поддерживает 
                         (2,3): gridmenu    #Координаты с плавающими числами в допустимом диапозоне
                     }   
                 )
             )    
        self.menu.quality = ui.Quality.Best #Для качества(по умолчанию Quality.Decent)
        self.menu.will_resize = True #Для оптимизации

    def draw_loop(self):
        self.menu.surface.fill(self.background)
        self.menu.draw()
        #рисуем меню
      
    def update_loop(self, events):
        self.menu.update()
        show_fps = True
        fps_mode = "Unslowed"
        #Для показа фпс
        if show_fps:
            print(f"FPS {fps_mode}: ",ui.time.fps)

def test_main():
    #Запускаем
    game = Mygame()
    game.run()

    sys.exit()

test_main()

Статус Nevu UI на данный момент

Макеты (Layout_Type)

(✅ - сделано, ❌ - не сделано, 💾 - устарело)

  • Grid
  • Row
  • Column
  • Scrollable
  • 💾 IntPickerGrid
  • Pages
  • 💾 Gallery_Pages
  • 💾 Appending_Layout_H
  • 💾 Appending_Layout_V
  • CheckBoxGroup

Виджеты (Widget)

  • Widget
  • Button
  • Label
  • Input
  • Empty_Widget
  • Tooltip (В 0.6)
  • 💾 ImageWidget
  • 💾 GifWidget
  • MusicPlayer (Будет переработан)
  • 💾 ProgressBar
  • 💾 SliderBar
  • 💾 ElementSwitcher
  • 💾 FileDialog
  • RectCheckBox

Лицензия

Nevu UI защищен лицензией MIT

Дополнительная информация

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

Uploaded CPython 3.14tWindows x86-64

nevu_ui-0.5.4-cp314-cp314t-musllinux_1_2_x86_64.whl (760.5 kB view details)

Uploaded CPython 3.14tmusllinux: musl 1.2+ x86-64

nevu_ui-0.5.4-cp314-cp314t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (766.5 kB view details)

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

nevu_ui-0.5.4-cp314-cp314t-macosx_11_0_arm64.whl (303.7 kB view details)

Uploaded CPython 3.14tmacOS 11.0+ ARM64

nevu_ui-0.5.4-cp314-cp314t-macosx_10_13_x86_64.whl (303.0 kB view details)

Uploaded CPython 3.14tmacOS 10.13+ x86-64

nevu_ui-0.5.4-cp314-cp314-win_amd64.whl (293.1 kB view details)

Uploaded CPython 3.14Windows x86-64

nevu_ui-0.5.4-cp314-cp314-musllinux_1_2_x86_64.whl (721.8 kB view details)

Uploaded CPython 3.14musllinux: musl 1.2+ x86-64

nevu_ui-0.5.4-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (722.7 kB view details)

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

nevu_ui-0.5.4-cp314-cp314-macosx_11_0_arm64.whl (295.8 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

nevu_ui-0.5.4-cp314-cp314-macosx_10_13_x86_64.whl (296.6 kB view details)

Uploaded CPython 3.14macOS 10.13+ x86-64

nevu_ui-0.5.4-cp313-cp313-win_amd64.whl (291.9 kB view details)

Uploaded CPython 3.13Windows x86-64

nevu_ui-0.5.4-cp313-cp313-musllinux_1_2_x86_64.whl (726.2 kB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

nevu_ui-0.5.4-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (730.0 kB view details)

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

nevu_ui-0.5.4-cp313-cp313-macosx_11_0_arm64.whl (295.7 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

nevu_ui-0.5.4-cp313-cp313-macosx_10_13_x86_64.whl (297.1 kB view details)

Uploaded CPython 3.13macOS 10.13+ x86-64

nevu_ui-0.5.4-cp312-cp312-win_amd64.whl (293.0 kB view details)

Uploaded CPython 3.12Windows x86-64

nevu_ui-0.5.4-cp312-cp312-musllinux_1_2_x86_64.whl (744.8 kB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

nevu_ui-0.5.4-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (747.1 kB view details)

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

nevu_ui-0.5.4-cp312-cp312-macosx_11_0_arm64.whl (297.1 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

nevu_ui-0.5.4-cp312-cp312-macosx_10_13_x86_64.whl (298.4 kB view details)

Uploaded CPython 3.12macOS 10.13+ x86-64

File details

Details for the file nevu_ui-0.5.4-cp314-cp314t-win_amd64.whl.

File metadata

  • Download URL: nevu_ui-0.5.4-cp314-cp314t-win_amd64.whl
  • Upload date:
  • Size: 302.9 kB
  • 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.5.4-cp314-cp314t-win_amd64.whl
Algorithm Hash digest
SHA256 e3dcb7eaf8239df5946cc6a2421c596e98da616042bd8d8d06298e80b7c56dce
MD5 92d10a01e3e0a69e28ecb01e1bb4881d
BLAKE2b-256 c03a8616ff04644d71e2721e96ab8abd70a121ebade367bc141025178a7ef838

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.5.4-cp314-cp314t-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 9aa9f6840de44ed93908f77d6d5394026b3ce9cd467efa1cea5f9f087803a624
MD5 48f92a72f400e1a92fddab3bf6d882b4
BLAKE2b-256 16ed065bec1968a27cbd022338526517419598a71ef5b79c4fbdb5ec73a36760

See more details on using hashes here.

File details

Details for the file nevu_ui-0.5.4-cp314-cp314t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.5.4-cp314-cp314t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 15cdebf6519a3332535ce0d8de233b354b5ac7ba06c7b50cf60eec8ff8cecf84
MD5 75099b0603c0b9bf066150f5ae0bdea0
BLAKE2b-256 c0ab63a02b3e83e936f11f79c5216783fae67877e4d985f1fed6fdf3fbf5157b

See more details on using hashes here.

File details

Details for the file nevu_ui-0.5.4-cp314-cp314t-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.5.4-cp314-cp314t-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d32a1201554794b70ab0db2d591cf33de7eac2fbe92d0969dd9c5d1c109f7f54
MD5 bf3b0c1c8f3743d47404b009e05e43c6
BLAKE2b-256 049a066cef4692564b4dea48a719d03540d7ff0b8dbbda26783096faba55a832

See more details on using hashes here.

File details

Details for the file nevu_ui-0.5.4-cp314-cp314t-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.5.4-cp314-cp314t-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 f11fa90112f756e51070ed33ba55f7fe621cda25de319ea208b333d6909805c2
MD5 1b97c36c3beaae6d20c2fb6f14cf9f03
BLAKE2b-256 83aa96ac33b2c35f5a41b46927c06b240dac7bde298150da3689765dfa38a412

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nevu_ui-0.5.4-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 293.1 kB
  • 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.5.4-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 c1badfc25e0a32ef652182a126c8770855328672c5285ad2413274ffd24a797d
MD5 f95e11b5043ff1682dbe230ffad0bdd0
BLAKE2b-256 208de66bf173949c529cb924e4c4fccaf692107c2c6d07ace4ea5fa81822d93a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.5.4-cp314-cp314-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 db04302aa98f0990e11d89feff8afe11e67e43720210945f0941164a3a2df61b
MD5 97fbfaf7715d9fd85657c236828fac20
BLAKE2b-256 fb6cd93fe1ef19e4b37534333791f7f643b7ca48180fb3ce5661c219f1300be7

See more details on using hashes here.

File details

Details for the file nevu_ui-0.5.4-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.5.4-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 2630e9583cb58819e20c3606f6df52c57fa7f9bd52c8165c3289aa2a99e6f23f
MD5 2e32a3b291ff2b7ae4e94e3bcdf7b121
BLAKE2b-256 5252f8419e2be962ca2dfaab384d4120c7da612674637d328093c3f930a9a67f

See more details on using hashes here.

File details

Details for the file nevu_ui-0.5.4-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.5.4-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6839a20616d37617d11423f814cebb5d06710f65eb9c70134b615cc83b624582
MD5 199ff8cb077c018863b8fec7b13a08b5
BLAKE2b-256 f008332e3cd724c90d4abdcf16179980e4f41b42474da38a052c4131eec2eb03

See more details on using hashes here.

File details

Details for the file nevu_ui-0.5.4-cp314-cp314-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.5.4-cp314-cp314-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 01ce36de1f6d8712ed3cfe7dd77b886d6dca858b16a2c27bed3ead51ff2dc0d2
MD5 bf42fc5b34f06c872c9fdd5abac9b49b
BLAKE2b-256 262758e54b7bd546b6c860d6cb67c3f44294cff07136dfc5a85c092c9674b784

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nevu_ui-0.5.4-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 291.9 kB
  • 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.5.4-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 52635aa3b201281d2474be9d9a7d2892744d558b87ef01f73becded499f5baca
MD5 f4ce914826a074182ddc45ee6e6e0dba
BLAKE2b-256 2b71185690e338227b55cd1a858de1f047b610cfd9b9a084830fc37edd670745

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.5.4-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 0a00875c9168db7cc1f504cf0665857e1988a2bf94b8a9b0ac2e7ea6a6d19531
MD5 62aa9a400d4e7ffafa848548608598ec
BLAKE2b-256 ad8a6c59d5c4dc34d754d6618975f7e37fdab328d811d939316943aa0b57f405

See more details on using hashes here.

File details

Details for the file nevu_ui-0.5.4-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.5.4-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 264b4b757aad99426b35b8449839295d938719f536d4541a33da1e5037933caf
MD5 55decd52a587313cb25567412d0b9779
BLAKE2b-256 d63a742a86dd72ebd3b7747324e15baf121e312db23c58cc2fb8ad56312f1042

See more details on using hashes here.

File details

Details for the file nevu_ui-0.5.4-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.5.4-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 42bbe413dac962717609a2b49a195653ff46f57186f83ce8a1f1a43d95da8e02
MD5 bc0f8430315d7df8515bde957f6df2c0
BLAKE2b-256 221349f52d8b310ded5a2a9ff3ef4a456eaad4ee6982b02e65bcb0426302ad51

See more details on using hashes here.

File details

Details for the file nevu_ui-0.5.4-cp313-cp313-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.5.4-cp313-cp313-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 ad986fecfab8bb336e03330c4d78a69807533f210ec9eba591fceefa878ed20a
MD5 3bc848aff07bedf442ca071f990121eb
BLAKE2b-256 1edacd7a53216ec9be258c7e1036c9560b35f0c70991050ce63ce873fb53cf2a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nevu_ui-0.5.4-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 293.0 kB
  • 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.5.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 6fbaeda17bd94a44be0927d96cd896f55430f93f54e47471c7b762a82c07e054
MD5 64fafec0ef16bef5929fa71ec20bcbd6
BLAKE2b-256 0322d8c255f326efdf8031cb9d9d7f297d97c3fc38e6e2f73610d351b111b522

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.5.4-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 eb5e74a0584ef48076755d9d4fa8bc143da7d091b543aa0b14db6a9581147e90
MD5 4b5be69e735cc1ea1210e730fc8a255b
BLAKE2b-256 b2e3be3d96bcfcf6c857f5c55596092b53767fda91b142b2388a336b90c5403a

See more details on using hashes here.

File details

Details for the file nevu_ui-0.5.4-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.5.4-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 dbe8be3a89a63de6094baf7a71cb8149f4298dc09e540c074fb22a19bfa7d649
MD5 697c0391fd329ab2fe2640ac9b4f4f5e
BLAKE2b-256 f6a5706f8f07489bbae58aedf1354c70a7abdd6381268be2cc782c92e24fce3a

See more details on using hashes here.

File details

Details for the file nevu_ui-0.5.4-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.5.4-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 85dd51713220c5be2bd8bd4f2adc375be17d45c66d3e0d91901248eed9dd032c
MD5 eec5da37a96c6656e08eba71c189d4dd
BLAKE2b-256 4266f616631e68a021c768ca02f088f7a1bc7bc89ac9d82efa12d44ecfda733a

See more details on using hashes here.

File details

Details for the file nevu_ui-0.5.4-cp312-cp312-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.5.4-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 7079904057bbc7e7c4dad834663e29d6fedc8473db8f5953382a37ab8c73d7de
MD5 d592f02e2e6c54f37cef24fa17031c0c
BLAKE2b-256 a717890091460d7e814ecfb81d96a5d71e5e74040039a569f91d07222ff44659

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