mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 12:43:34 +00:00
166686e0f2
# Objective The name `TextAlignment` is really deceptive and almost every new user gets confused about the differences between aligning text with `TextAlignment`, aligning text with `Style` and aligning text with anchor (when using `Text2d`). ## Solution * Rename `TextAlignment` to `JustifyText`. The associated helper methods are also renamed. * Improve the doc comments for text explaining explicitly how the `JustifyText` component affects the arrangement of text. * Add some extra cases to the `text_debug` example that demonstate the differences between alignment using `JustifyText` and alignment using `Style`. <img width="757" alt="text_debug_2" src="https://github.com/bevyengine/bevy/assets/27962798/9d53e647-93f9-4bc7-8a20-0d9f783304d2"> --- ## Changelog * `TextAlignment` has been renamed to `JustifyText` * `TextBundle::with_text_alignment` has been renamed to `TextBundle::with_text_justify` * `Text::with_alignment` has been renamed to `Text::with_justify` * The `text_alignment` field of `TextMeasureInfo` has been renamed to `justification` ## Migration Guide * `TextAlignment` has been renamed to `JustifyText` * `TextBundle::with_text_alignment` has been renamed to `TextBundle::with_text_justify` * `Text::with_alignment` has been renamed to `Text::with_justify` * The `text_alignment` field of `TextMeasureInfo` has been renamed to `justification` |
||
---|---|---|
.. | ||
3d_gizmos.rs | ||
3d_scene.rs | ||
3d_shapes.rs | ||
3d_viewport_to_world.rs | ||
anti_aliasing.rs | ||
atmospheric_fog.rs | ||
blend_modes.rs | ||
bloom_3d.rs | ||
deferred_rendering.rs | ||
fog.rs | ||
generate_custom_mesh.rs | ||
lighting.rs | ||
lines.rs | ||
load_gltf.rs | ||
orthographic.rs | ||
parallax_mapping.rs | ||
parenting.rs | ||
pbr.rs | ||
render_to_texture.rs | ||
shadow_biases.rs | ||
shadow_caster_receiver.rs | ||
skybox.rs | ||
spherical_area_lights.rs | ||
split_screen.rs | ||
spotlight.rs | ||
ssao.rs | ||
texture.rs | ||
tonemapping.rs | ||
transmission.rs | ||
transparency_3d.rs | ||
two_passes.rs | ||
update_gltf_scene.rs | ||
vertex_colors.rs | ||
wireframe.rs |