Skip to content

InlineBox, inline content tracking issue #25723

Description

@ickshonpe

Initial PR in review

InlineBox and InlineImage #25710

This implements a bevy_text API using an InlineBox component that can be used to reserve space in text layouts for inline content. Also includes a limited inline image widget, InlineImage.

InlineBox improvements

  • Picking support for inline boxes.
  • InlineBoxKind::CustomOutOfFlow support. Like OutOfFlow, CustomOutOfFlow boxes don't take space in the layout, but also their positions are not determined by Parley either, which yields back control to the caller to determine where the box should be placed.
  • Vertical alignment support. At the moment inline boxes always sits on the baseline. Parley has vertical-align support in review: Implement the vertical-align style linebender/parley#766.
  • Transform support for InlineBox. Could be tricky, might need some sort of new InlineTransform component.
  • Anchor positioning. OutOfFlow boxes can be used to target a specific position in the text to attach a tooltip or popover.

InlineImage improvements

  • Image flipping support.
  • Texture atlas support.
  • Custom sizing modes.
  • Improve the inline_image example. Probably better done last, once there's something to show off.
  • Text2d support.

Other InlineBox widgets

More complex widgets should probably be implemented as inline UI nodes. But each inline UI node would require creating a new layout context, which could be too heavy and expensive for more trivial widgets.

  • Checkboxes
  • Buttons
  • Spacers. Just creates empty space. InlineBox can be used by itself for this, but it isn't ideal as it doesn't support responsive values.
  • Filled Rectangles. Maybe with borders and rounded corners.
  • Custom animated emotes. bevy_text already supports unicode emojis.

bevy_ui features

  • Inline UI nodes. Basic idea: query for Entity, (With<Node>, With<InlineBox>) and make each entity a new layout root with an implicit viewport the size of the InlineBox. This will have to wait until Incremental UI updates #25653 lands though.

Advanced (probably best left to third party crates)

  • Inline math.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-TextRendering and layout for charactersA-UIGraphical user interfaces, styles, layouts, and widgetsC-FeatureA new feature, making something new possibleC-Tracking-IssueAn issue that collects information about a broad development initiative

    Type

    No type

    Projects

    • Status
      Needs SME Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions