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


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

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
  • StackColumn
  • StackRow
  • 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.8-cp314-cp314t-win_amd64.whl (645.2 kB view details)

Uploaded CPython 3.14tWindows x86-64

nevu_ui-0.5.8-cp314-cp314t-musllinux_1_2_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.14tmusllinux: musl 1.2+ x86-64

nevu_ui-0.5.8-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (1.7 MB view details)

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

nevu_ui-0.5.8-cp314-cp314t-macosx_11_0_arm64.whl (648.6 kB view details)

Uploaded CPython 3.14tmacOS 11.0+ ARM64

nevu_ui-0.5.8-cp314-cp314t-macosx_10_13_x86_64.whl (646.1 kB view details)

Uploaded CPython 3.14tmacOS 10.13+ x86-64

nevu_ui-0.5.8-cp314-cp314-win_amd64.whl (619.5 kB view details)

Uploaded CPython 3.14Windows x86-64

nevu_ui-0.5.8-cp314-cp314-musllinux_1_2_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.14musllinux: musl 1.2+ x86-64

nevu_ui-0.5.8-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (1.6 MB view details)

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

nevu_ui-0.5.8-cp314-cp314-macosx_11_0_arm64.whl (634.2 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

nevu_ui-0.5.8-cp314-cp314-macosx_10_13_x86_64.whl (635.6 kB view details)

Uploaded CPython 3.14macOS 10.13+ x86-64

nevu_ui-0.5.8-cp313-cp313-win_amd64.whl (617.2 kB view details)

Uploaded CPython 3.13Windows x86-64

nevu_ui-0.5.8-cp313-cp313-musllinux_1_2_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

nevu_ui-0.5.8-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (1.6 MB view details)

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

nevu_ui-0.5.8-cp313-cp313-macosx_11_0_arm64.whl (633.3 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

nevu_ui-0.5.8-cp313-cp313-macosx_10_13_x86_64.whl (635.5 kB view details)

Uploaded CPython 3.13macOS 10.13+ x86-64

nevu_ui-0.5.8-cp312-cp312-win_amd64.whl (619.3 kB view details)

Uploaded CPython 3.12Windows x86-64

nevu_ui-0.5.8-cp312-cp312-musllinux_1_2_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

nevu_ui-0.5.8-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (1.6 MB view details)

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

nevu_ui-0.5.8-cp312-cp312-macosx_11_0_arm64.whl (636.6 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

nevu_ui-0.5.8-cp312-cp312-macosx_10_13_x86_64.whl (639.2 kB view details)

Uploaded CPython 3.12macOS 10.13+ x86-64

File details

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

File metadata

  • Download URL: nevu_ui-0.5.8-cp314-cp314t-win_amd64.whl
  • Upload date:
  • Size: 645.2 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.8-cp314-cp314t-win_amd64.whl
Algorithm Hash digest
SHA256 e9f128519695087e9b85e58b8691c548c1f020e16f5723ebbab974566fec8deb
MD5 c9d94edd764555b43654bbdaf5b710f8
BLAKE2b-256 33eef00ce70cb24f983430ae849379001bc8c02dd62e3b48b74fb65fdac14808

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.5.8-cp314-cp314t-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 c3a0691a7f0ef1373ee37f49bbf86fa5255c9091a2a9f5c2eec843b25b218071
MD5 0e7ffb473805286745c5961c89a4d87a
BLAKE2b-256 359d42ad5bbd0cd75613b50150704fba9b962cb3a55a10eab2b1b9a429ac651c

See more details on using hashes here.

File details

Details for the file nevu_ui-0.5.8-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.5.8-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f8712ce49f5f43307f4b446f5874b7510ea69b7b2e4d3b24e7d8fa56bcbf5cf3
MD5 966dc615aced620a56cc88785b35b8eb
BLAKE2b-256 cb9d81229f77e8289594a9975e525b7e185356cbc9879cd5f65ebba9e87b6511

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.5.8-cp314-cp314t-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 76f844643c3ff7b6d765c502f8fd803d5234a0ba23bd33618f405f02db43acca
MD5 4fd296a65d411df81b84ace56c92a684
BLAKE2b-256 a026b1266b428b6e1eef75ad0431f0149d51dedb8dc6e0764e5568112ddb2219

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.5.8-cp314-cp314t-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 2b2565a7533ea92a80fe030899439213698515176152c44cc4ca8469f8afe4b3
MD5 c2cce2d165744823c9adeef8fcb7a44c
BLAKE2b-256 4aeaf129f291062324df82110b53a80f747af4288df9c3099ac442625ae7f780

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nevu_ui-0.5.8-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 619.5 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.8-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 2d5deba7f1dfa0465c8e10f7c8621c7eb946c927a9658bd1e64fe2f25ebeb037
MD5 6f1a9a6f84b3147138c9a99fff1a36b3
BLAKE2b-256 ccb53bfbab77f3b47e3e6bd8d2377612eab096dfde68259780210849a6b76489

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.5.8-cp314-cp314-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 1bad0144e2a2887d997a64a03dc687bf738123db3271df7b50975c8e61090724
MD5 a65e252cbdb3703e952423ebe9d5ee24
BLAKE2b-256 05ab330779c81148c05300253493edfd77330dd3ef481868bb469f9f8096bc76

See more details on using hashes here.

File details

Details for the file nevu_ui-0.5.8-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.5.8-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f69321ae7a03b863728932e88245fa49d24c5643cdf97382a2da689674403c5f
MD5 8aa8b84c792da25c948d09e41eb757b9
BLAKE2b-256 c5a150d8ca61c03887162110f8f05d1f2857b7647123db29e0b9a85dec700460

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.5.8-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bd79576706a5922245901ef8537b6f2a692264861d8c9fe79a7c08127884c218
MD5 b195e08a028376d301bc2f98e8431b8b
BLAKE2b-256 eff628e273c4ef4e0700f309a130db6a038b7a9b09c226590451298db9a26adc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.5.8-cp314-cp314-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 0e5255a7f23d5eed5d98bea6e6bca8cbe5edde23df44b84bee318d5c807e22f8
MD5 85f6dd1a8a2d41d55c8688448592612b
BLAKE2b-256 0cac422926ca8a83c37d579a16b29b22d448f3072af5c516fbd0deefb6ed8a0b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nevu_ui-0.5.8-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 617.2 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.8-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 7999efda9dab8e9b0721f292fa9e2627a113fccd0137cabfba8c47e0f0b3fbed
MD5 e4931a706553510970deda3df379fc31
BLAKE2b-256 51c396a498ec564255ad16c18405b7099a8bee6d77a11ed5508b269138feabb6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.5.8-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 082369fda561bf122ec665cb3d2a4c4725a21f8e0614519696bf165731338316
MD5 36e980ce9bd5b32173b339e1f7b5dac2
BLAKE2b-256 1ddb8d948c0e1c10489cd701b5f0f43168a74446c36f9bc068c3eede89cd6d13

See more details on using hashes here.

File details

Details for the file nevu_ui-0.5.8-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.5.8-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d2fe56e69ea1cfd0c2244501d10c5d4aa68da6504fae30d5fe908a0c9ad4e704
MD5 962e455e8c8ec38e17305a9ac1206c15
BLAKE2b-256 7ab4b53a67376e5ac6bcda58fb846b89571855ee4302b2906213eff5c5b2af0a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.5.8-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4d14faf1f030e8abdf3d7c0f2e2db246bc96c33b1de66249131b0be67d3ea9c0
MD5 9f3914b08ffb530048da0a69e014c1dd
BLAKE2b-256 da328727947d34af2c927b189c8570cee05de9972db85146bb614a96b19e86f0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.5.8-cp313-cp313-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 a544e25a9c04308df558a3b001acdff090b861bdf141bffe75a820d03898001e
MD5 76dae1f9fb3a71f84b551edfe48a22ea
BLAKE2b-256 3e65c54eb77b7ae59af1063c45367bd50c30069e840258467d872a2993a709d5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nevu_ui-0.5.8-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 619.3 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.8-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 32b0f8985aadaa9b6dc0dc082788e12e79277ac963f285036e8e0bfe1a45f5dc
MD5 be2424e4e1d495312e1d9fd442aeb433
BLAKE2b-256 ca3dc34b9cb9c0ff7d86585c1c1e5dcee2124274c879ab4b4c99530fb6254fc0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.5.8-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 b7bbd443c8f1678e8f03f29af3b331d0ee3a62890d607c436037c7673dbd5fd7
MD5 1d7d344d1451b32952d35b851b9ff346
BLAKE2b-256 230f2d2176aa53eb846d8ad9d2b0d3198a9314457024bea01ce251234eacfc9d

See more details on using hashes here.

File details

Details for the file nevu_ui-0.5.8-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.5.8-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ebdf2bc35ebf2aac8fd7d5b18d4022801953979bc7b3954e0b62d48a386f054f
MD5 e1109fe8f58572c59a072239bd858c3a
BLAKE2b-256 5499f3cf217b27a16a1a55f2f351240d0fbaf4a120eff3dab46df25898e71337

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.5.8-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ffbfcd36f146342f6e935622add2d6ac431bd6b7550972631b9a638135c8dcec
MD5 95201c9bdc5a1600efff20ae0ef22d48
BLAKE2b-256 da3c50ff7ac5ad8e222fa34e2fa27fd17eed783fc69b080f66a4ea0e91591e2c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.5.8-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 2bb0f86dede09bb7ada1d3016b509cb31a05785d5285d3e3778ad896e1ec7b7b
MD5 5996677c761c17b598a37215b3159a38
BLAKE2b-256 993f5aa41bec03fdbfbe7d70510abe279ba918ccd5c0804196897e8ccefa692e

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