mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-22 01:53:55 +08:00
* pyray init version * remove c++ code * cleanup * restruct the directory layout * improve GuiApplication * smooth out the texture after resize * use atexit to close app * rename FontSize->FontWeight * make files executable * use Inter Regular for FrontWeight.NORMAL * set FLAG_VSYNC_HINT to avoid tearing while scrolling * smoother scrolling * mange textures in gui_app
14 lines
570 B
Python
14 lines
570 B
Python
import pyray as rl
|
|
from openpilot.system.ui.lib.utils import GuiStyleContext
|
|
|
|
def gui_label(rect, text, font_size):
|
|
styles = [
|
|
(rl.GuiControl.DEFAULT, rl.GuiDefaultProperty.TEXT_SIZE, font_size),
|
|
(rl.GuiControl.DEFAULT, rl.GuiDefaultProperty.TEXT_LINE_SPACING, font_size),
|
|
(rl.GuiControl.DEFAULT, rl.GuiDefaultProperty.TEXT_ALIGNMENT_VERTICAL, rl.GuiTextAlignmentVertical.TEXT_ALIGN_TOP),
|
|
(rl.GuiControl.DEFAULT, rl.GuiDefaultProperty.TEXT_WRAP_MODE, rl.GuiTextWrapMode.TEXT_WRAP_WORD)
|
|
]
|
|
|
|
with GuiStyleContext(styles):
|
|
rl.gui_label(rect, text)
|