Skip to content

how to create a splited text on a container. #329

Answered by MyreMylar
EntropicPhys asked this question in Q&A
Discussion options

You must be logged in to vote

Like this?

Code:

import pygame

from pygame_gui import UIManager
from pygame_gui.elements import UITextEntryLine
from pygame_gui.elements import UILabel
from pygame_gui.elements import UIPanel
from pygame_gui.elements import UIScrollingContainer

pygame.init()

window_size = (800, 600)
window_surf = pygame.display.set_mode(window_size)

ui_manager = UIManager(window_size)


panel = UIPanel(pygame.Rect(50, 50, 250, 300), starting_layer_height=1, manager=ui_manager)
scrolling_container = UIScrollingContainer(pygame.Rect(0, 0, 250, 300), manager=ui_manager, container=panel)
scrolling_container.set_scrollable_area_dimensions((250, 500))

for y in range(0, 10):
    item_label = UILabel(pygame…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@EntropicPhys
Comment options

Answer selected by EntropicPhys
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants