bevyengine / bevyengine/bevy

Intersperse text and images

Open
#17,968 1 comment 0 reactions 0 assignees View on GitHub
A-Text A-UI C-Feature S-Blocked
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?

Allow images to be interspersed with wrapped text as though the images are glyphs.

## What solution would you like?

An `ImageSpan` component containing the image handle and color that can be added as a child to text nodes in the same way that `TextSpan`s can be.

## What alternative(s) have you considered?

You can do a manual text layout by making each word into a distinct `Text` node with flex wrap. Then you can just add `ImageNode`s amongst the text nodes. It's extremely awkward and inefficient though.

## Additional context

Maybe we could use a "font" with images as glyphs. I'm not sure what cosmic text supports.

Contributor guide

Open the contributing guide

Research direction

Start by tracing Bevy's existing text-node and TextSpan implementation, then investigate how cosmic text could represent inline images. Done means an ImageSpan can carry an image handle and color and be added among text spans so wrapped text and images flow together.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
game-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.