[Python] How do you wrap text in an Ursina button?

Discussão em 'Python' iniciado por Stack, Junho 27, 2025.

  1. Stack

    Stack Membro Participativo

    I am able to wrap text in Text entities without issue, yet the "same" method doesn't seem to work for Button entities.

    The code below demonstrates applying the same logic, yet the Button text will not wrap.

    What needs to be changed to wrap the text in the Button?

    from ursina import *

    app = Ursina()

    text_entity = Text(
    wordwrap = 10,
    text = "This line wraps, just as expected.",
    y = 0.1)

    button_entity = Button(
    scale = 0.1,
    text = "Now, why won't my button text do the same? ",
    y = -0.1)

    button_entity.text_entity.word_wrap = 10

    app.run()

    Continue reading...

Compartilhe esta Página