bevyengine / bevyengine/bevy

Add option to allow UI text to scale with parent.

Open
#9,280 3 comments 1 reaction 0 assignees View on GitHub
A-Text A-UI C-Feature
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## What problem does this solve or what need does it fill?

Most games that allow for resizable windows scale their UI with the window, including text within it. In Bevy, this is currently not possible (to my knowledge).

## What solution would you like?

Optimally, one would be able to specify a font_size as a Val similar to how text works in CSS, however, to my understanding, this would be awkward as bevy_text is its own crate. Instead, a better way would be to have a set font size that works as a resolution but then also a sort of scale factor for the screen that would allow the text to stretch and shrink in order to allow what I mention above.

## What alternative(s) have you considered?

None really. I've looked around and asked the Discord and multiple people have said as it stands, this is impossible without dynamically manually changing the font size which isn't reasonable since how would I or the program know what exact size is needed to have the text fill the X dimension of the parent node?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.