-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Closed
Labels
A-UIGraphical user interfaces, styles, layouts, and widgetsGraphical user interfaces, styles, layouts, and widgetsC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorD-TrivialNice and easy! A great choice to get started with BevyNice and easy! A great choice to get started with Bevy
Description
Bevy version
v0.4.0
Operating system & version
macOS 10.15.7
What you did
use bevy::prelude::*;
fn main() {
App::build()
.add_plugins(DefaultPlugins)
.add_startup_system(setup.system())
.run();
}
fn setup(commands: &mut Commands, asset_server: Res<AssetServer>) {
commands
.spawn(CameraUiBundle::default())
.spawn(TextBundle {
text: Text {
value: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas auctor, nunc ac faucibus fringilla.".to_string(),
font: asset_server.load("fonts/FiraSans-Bold.ttf"),
style: TextStyle {
font_size: 60.0,
color: Color::WHITE,
..Default::default()
},
},
style: Style {
position_type: PositionType::Absolute,
position: Rect {
left: Val::Px(0.0),
top: Val::Px(0.0),
..Default::default()
},
max_size: Size::new(Val::Percent(50.0), Val::Percent(100.0)),
..Default::default()
},
..Default::default()
});
}
What you expected to happen
I expected it to wrap the text at half the window width.
What actually happened
It doesn't wrap the text. It runs right up to the right edge of the window.
Additional information
It seems that setting a max_size
with Val::Px()
works, but percent doesn't.
Metadata
Metadata
Assignees
Labels
A-UIGraphical user interfaces, styles, layouts, and widgetsGraphical user interfaces, styles, layouts, and widgetsC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorD-TrivialNice and easy! A great choice to get started with BevyNice and easy! A great choice to get started with Bevy