Skip to content

Add TextLayoutInfo to TextBundle and Text2dBundle#7748

Closed
ickshonpe wants to merge 3 commits intobevyengine:mainfrom
ickshonpe:add-TextLayoutInfo-to-TextBundle
Closed

Add TextLayoutInfo to TextBundle and Text2dBundle#7748
ickshonpe wants to merge 3 commits intobevyengine:mainfrom
ickshonpe:add-TextLayoutInfo-to-TextBundle

Conversation

@ickshonpe
Copy link
Contributor

@ickshonpe ickshonpe commented Feb 19, 2023

Objective

TextBundle and Text2dBundle don't have TextLayoutInfo components. Instead, TextLayoutInfo is inserted by the update_2d_layout and text_system systems. This seems to be both more complicated and marginally less efficient than just adding the component to the bundles directly.

Solution

  • Add the TextLayoutInfo component to the TextBundle and Text2dBundle bundles.
  • Change optional TextLayoutInfo queries to non-optional.
  • Clean up the text systems by removing the Commands parameters and match statements.

Changelog

  • Added the TextLayoutInfo component to TextBundle.
  • Added the TextLayoutInfo component to Text2dBundle.
  • Changed optional TextLayoutInfo queries to be non-optional.

Migration Guide

The TextLayoutInfo component has been added to TextBundle and Text2dBundle.

To draw text using the text2d or ui text systems entities must have the TextLayoutInfo component.

    * Added the `TextLayoutInfo` component to `TextBundle`.
    * Added the `TextLayoutInfo` component to `Text2dBundle`.
    * Changed `TextLayoutInfo` queries to be non-optional.
@james7132 james7132 added A-UI Graphical user interfaces, styles, layouts, and widgets C-Usability A targeted quality-of-life change that makes Bevy easier to use labels Feb 20, 2023
@ickshonpe
Copy link
Contributor Author

Closed, as this was done in #7779.

@ickshonpe ickshonpe closed this May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-UI Graphical user interfaces, styles, layouts, and widgets C-Usability A targeted quality-of-life change that makes Bevy easier to use

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants