Label
Label
A widget that displays text.
Specific kwargs
| Argument |
Type |
Description |
text |
str |
initial text. |
words_indent |
bool |
if True, the text when overflows will be splitted into words(default is False). |
Getters
| Name |
ReturnType |
Description |
text |
str |
current text. |
Setters
| Name |
Kwargs |
Description |
text |
text |
overwrites current text with a new one. |
Use case
from nevu_ui import *
import pygame
pygame.init()
window = Window((500, 500), title = "Label example")
menu = Menu(window, (100%vw, 100%vh))
layout = Grid([100%fillw, 100%fillh], x=3, y=3)
widget = Label("Text", (100, 100))
layout.add_item(widget, 2, 2)
menu.layout = layout
while True:
window.begin_frame()
window.update()
menu.update()
menu.draw()
window.end_frame()
from nevu_ui import *
import pyray
window = Window((500, 500), title = "Label example", backend = Backend.RayLib)
menu = Menu(window, (100%vw, 100%vh))
layout = Grid([100%fillw, 100%fillh], x=3, y=3)
widget = Label("Text", (100, 100))
layout.add_item(widget, 2, 2)
menu.layout = layout
while True:
window.begin_frame()
window.update()
menu.update()
menu.draw()
window.end_frame()
Created with GGen v1.1.0 for nevu_ui v0.7.5