-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Closed
Labels
A-RenderingDrawing game state to the screenDrawing game state to the screenA-TextRendering and layout for charactersRendering and layout for charactersA-UIGraphical user interfaces, styles, layouts, and widgetsGraphical user interfaces, styles, layouts, and widgetsC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behavior
Description
Bevy version
- v0.5.0
- v0.6.0
- v0.7.0
Operating system & version
Linux/Wayland
What you did
Modify the camera in the text2d example to use a scale of 0.1:
use bevy::prelude::*;
use bevy::render::camera::{DepthCalculation, OrthographicProjection};
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_startup_system(setup)
.run();
}
fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
commands
.spawn_bundle(OrthographicCameraBundle::new_2d())
.insert(OrthographicProjection {
near: 0.0,
far: 1000.0,
scale: 0.1,
depth_calculation: DepthCalculation::ZDifference,
..Default::default()
});
commands.spawn_bundle(Text2dBundle {
text: Text::with_section(
"Hello.",
TextStyle {
font: asset_server.load("fonts/FiraSans-Bold.ttf"),
font_size: 25.0,
color: Color::WHITE,
},
TextAlignment {
vertical: VerticalAlign::Center,
horizontal: HorizontalAlign::Center,
},
),
..Default::default()
});
}
What you expected to happen
The text should rasterize properly with no visible artifacts.
What actually happened
The text is rasterized to 10x10 pixel squares (1/scale).
Additional information
This can also be seen with ScalingMode::FixedHorizontal when the scale does not match the window's width:
// ...
.insert(OrthographicProjection {
near: 0.0,
far: 1000.0,
window_origin: WindowOrigin::Center,
scaling_mode: ScalingMode::FixedHorizontal,
scale: 100.0,
depth_calculation: DepthCalculation::ZDifference,
..Default::default()
});
// ...
(The same applies to ScalingMode::FixedVertical, of course.)
Giesch, benfrankel, LLBlumire, musjj and jjyr
Metadata
Metadata
Assignees
Labels
A-RenderingDrawing game state to the screenDrawing game state to the screenA-TextRendering and layout for charactersRendering and layout for charactersA-UIGraphical user interfaces, styles, layouts, and widgetsGraphical user interfaces, styles, layouts, and widgetsC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behavior
