Skip to content

GUI: let kerboscripts turn off wordWrap so things format properly #2599

@Dunbaratu

Description

@Dunbaratu

Unity's IMGUI has a field on GUISkin called ``wordWrap` that decides whether or not it's allowed to break up labels on word boundaries to make them fit. We have it on by default. But that is the main reason the GUI displays come out all wonky by default. Someone makes a gui with a label like "This is My Label" and it displays like this instead:

This
is My
Label

The only way to stop it doing that is to set a fixed width to the GUI box like so: GUI(400). If the hardcoded size is long enough to make it not need to wrap, that's the only way to stop it wrapping. As long as you're letting it stretch and flow the content and decide the box size for you, it will always seem to prefer the narrower window, and if it has to break up things in a silly way to do that, it will choose to do so, giving the effect shown above.

We should expose wordWrap so users can fix this annoying feature of Unity IMGUI. I might even want to see it be the default but that might mess it up for other people.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementSomething new (not a bug fix) is being requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions