Skip to content

Commit 81c4ee5

Browse files
committed
reduce changelog in examples
1 parent 4da3a40 commit 81c4ee5

19 files changed

+42
-43
lines changed

examples/2d/text2d.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ struct AnimateScale;
3434
fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
3535
let font = asset_server.load("fonts/FiraSans-Bold.ttf");
3636
let text_style = TextStyle {
37-
font: font.clone().into(),
37+
font: font.clone(),
3838
font_size: 60.0,
3939
color: Color::WHITE,
4040
};
@@ -68,7 +68,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
6868
));
6969
// Demonstrate text wrapping
7070
let slightly_smaller_text_style = TextStyle {
71-
font: font.into(),
71+
font,
7272
font_size: 42.0,
7373
color: Color::WHITE,
7474
};

examples/games/contributors.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,13 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
147147
TextSection::new(
148148
"Contributor showcase",
149149
TextStyle {
150-
font: asset_server.load("fonts/FiraSans-Bold.ttf").into(),
150+
font: asset_server.load("fonts/FiraSans-Bold.ttf"),
151151
font_size: 60.0,
152152
..default()
153153
},
154154
),
155155
TextSection::from_style(TextStyle {
156-
font: asset_server.load("fonts/FiraSans-Bold.ttf").into(),
156+
font: asset_server.load("fonts/FiraSans-Bold.ttf"),
157157
font_size: 60.0,
158158
..default()
159159
}),

examples/input/text_input.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,47 +37,47 @@ fn setup_scene(mut commands: Commands, asset_server: Res<AssetServer>) {
3737
TextSection {
3838
value: "IME Enabled: ".to_string(),
3939
style: TextStyle {
40-
font: font.clone_weak().into(),
40+
font: font.clone_weak(),
4141
font_size: 20.0,
4242
..default()
4343
},
4444
},
4545
TextSection {
4646
value: "false\n".to_string(),
4747
style: TextStyle {
48-
font: font.clone_weak().into(),
48+
font: font.clone_weak(),
4949
font_size: 30.0,
5050
..default()
5151
},
5252
},
5353
TextSection {
5454
value: "IME Active: ".to_string(),
5555
style: TextStyle {
56-
font: font.clone_weak().into(),
56+
font: font.clone_weak(),
5757
font_size: 20.0,
5858
..default()
5959
},
6060
},
6161
TextSection {
6262
value: "false\n".to_string(),
6363
style: TextStyle {
64-
font: font.clone_weak().into(),
64+
font: font.clone_weak(),
6565
font_size: 30.0,
6666
..default()
6767
},
6868
},
6969
TextSection {
7070
value: "click to toggle IME, press return to start a new line\n\n".to_string(),
7171
style: TextStyle {
72-
font: font.clone_weak().into(),
72+
font: font.clone_weak(),
7373
font_size: 18.0,
7474
..default()
7575
},
7676
},
7777
TextSection {
7878
value: "".to_string(),
7979
style: TextStyle {
80-
font: font.into(),
80+
font,
8181
font_size: 25.0,
8282
..default()
8383
},
@@ -95,7 +95,7 @@ fn setup_scene(mut commands: Commands, asset_server: Res<AssetServer>) {
9595
text: Text::from_section(
9696
"".to_string(),
9797
TextStyle {
98-
font: asset_server.load("fonts/FiraMono-Medium.ttf").into(),
98+
font: asset_server.load("fonts/FiraMono-Medium.ttf"),
9999
font_size: 100.0,
100100
..default()
101101
},

examples/stress_tests/text_pipeline.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ fn spawn(mut commands: Commands, asset_server: Res<AssetServer>) {
3939
TextSection {
4040
value: "text".repeat(i),
4141
style: TextStyle {
42-
font: asset_server.load("fonts/FiraMono-Medium.ttf").into(),
42+
font: asset_server.load("fonts/FiraMono-Medium.ttf"),
4343
font_size: (4 + i % 10) as f32,
4444
color: Color::BLUE,
4545
},
4646
},
4747
TextSection {
4848
value: "pipeline".repeat(i),
4949
style: TextStyle {
50-
font: asset_server.load("fonts/FiraSans-Bold.ttf").into(),
50+
font: asset_server.load("fonts/FiraSans-Bold.ttf"),
5151
font_size: (4 + i % 11) as f32,
5252
color: Color::YELLOW,
5353
},

examples/ui/button.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
9090
parent.spawn(TextBundle::from_section(
9191
"Button",
9292
TextStyle {
93-
font: asset_server.load("fonts/FiraSans-Bold.ttf").into(),
93+
font: asset_server.load("fonts/FiraSans-Bold.ttf"),
9494
font_size: 40.0,
9595
color: Color::rgb(0.9, 0.9, 0.9),
9696
},

examples/ui/flex_layout.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ fn spawn_nested_text_bundle(
172172
builder.spawn(TextBundle::from_section(
173173
text,
174174
TextStyle {
175-
font: font.into(),
175+
font,
176176
font_size: 24.0,
177177
color: Color::BLACK,
178178
},

examples/ui/font_atlas_debug.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>, mut state: ResM
9292
parent.spawn(TextBundle::from_section(
9393
"a",
9494
TextStyle {
95-
font: font_handle.into(),
95+
font: font_handle,
9696
font_size: 60.0,
9797
color: Color::YELLOW,
9898
},

examples/ui/grid.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,15 +142,15 @@ fn spawn_layout(mut commands: Commands, asset_server: Res<AssetServer>) {
142142
builder.spawn(TextBundle::from_section(
143143
"Sidebar",
144144
TextStyle {
145-
font: font.clone().into(),
145+
font: font.clone(),
146146
font_size: 24.0,
147147
..default()
148148
},
149149
));
150150
builder.spawn(TextBundle::from_section(
151151
"A paragraph of text which ought to wrap nicely. A paragraph of text which ought to wrap nicely. A paragraph of text which ought to wrap nicely. A paragraph of text which ought to wrap nicely. A paragraph of text which ought to wrap nicely. A paragraph of text which ought to wrap nicely. A paragraph of text which ought to wrap nicely.",
152152
TextStyle {
153-
font: font.clone().into(),
153+
font: font.clone(),
154154
font_size: 16.0,
155155
..default()
156156
},
@@ -222,7 +222,7 @@ fn spawn_nested_text_bundle(builder: &mut ChildBuilder, font: Handle<Font>, text
222222
builder.spawn(TextBundle::from_section(
223223
text,
224224
TextStyle {
225-
font: font.into(),
225+
font,
226226
font_size: 24.0,
227227
color: Color::BLACK,
228228
},

examples/ui/overflow.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
1515
commands.spawn(Camera2dBundle::default());
1616

1717
let text_style = TextStyle {
18-
font: asset_server.load("fonts/FiraMono-Medium.ttf").into(),
18+
font: asset_server.load("fonts/FiraMono-Medium.ttf"),
1919
font_size: 20.0,
2020
..default()
2121
};

examples/ui/overflow_debug.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
108108
]
109109
.join(" · "),
110110
TextStyle {
111-
font: asset_server.load("fonts/FiraSans-Bold.ttf").into(),
111+
font: asset_server.load("fonts/FiraSans-Bold.ttf"),
112112
font_size: 18.0,
113113
..default()
114114
},
@@ -183,7 +183,7 @@ fn spawn_text(
183183
parent.spawn(TextBundle::from_section(
184184
"Bevy",
185185
TextStyle {
186-
font: asset_server.load("fonts/FiraSans-Bold.ttf").into(),
186+
font: asset_server.load("fonts/FiraSans-Bold.ttf"),
187187
font_size: 120.0,
188188
..default()
189189
},

examples/ui/relative_cursor_position.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
4545
text: Text::from_section(
4646
"(0.0, 0.0)",
4747
TextStyle {
48-
font: asset_server.load("fonts/FiraSans-Bold.ttf").into(),
48+
font: asset_server.load("fonts/FiraSans-Bold.ttf"),
4949
font_size: 40.0,
5050
color: Color::rgb(0.9, 0.9, 0.9),
5151
},

examples/ui/size_constraints.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
4343
commands.spawn(Camera2dBundle::default());
4444

4545
let text_style = TextStyle {
46-
font: asset_server.load("fonts/FiraSans-Bold.ttf").into(),
46+
font: asset_server.load("fonts/FiraSans-Bold.ttf"),
4747
font_size: 40.0,
4848
color: Color::rgb(0.9, 0.9, 0.9),
4949
};

examples/ui/text.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
3434
// Accepts a `String` or any type that converts into a `String`, such as `&str`
3535
"hello\nbevy!",
3636
TextStyle {
37-
font: asset_server.load("fonts/FiraSans-Bold.ttf").into(),
37+
font: asset_server.load("fonts/FiraSans-Bold.ttf"),
3838
font_size: 100.0 / 1.2,
3939
..default()
4040
},

examples/ui/text_debug.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ fn infotext_system(mut commands: Commands, asset_server: Res<AssetServer>) {
3333
TextBundle::from_section(
3434
"This is\ntext with\nline breaks\nin the top left",
3535
TextStyle {
36-
font: font.clone().into(),
36+
font: font.clone(),
3737
font_size: 50.0,
3838
..default()
3939
},
@@ -48,7 +48,7 @@ fn infotext_system(mut commands: Commands, asset_server: Res<AssetServer>) {
4848
commands.spawn(TextBundle::from_section(
4949
"This text is very long, has a limited width, is centered, is positioned in the top right and is also colored pink.",
5050
TextStyle {
51-
font: font.clone().into(),
51+
font: font.clone(),
5252
font_size: 50.0,
5353
color: Color::rgb(0.8, 0.2, 0.7),
5454
},
@@ -67,41 +67,41 @@ fn infotext_system(mut commands: Commands, asset_server: Res<AssetServer>) {
6767
TextSection::new(
6868
"This text changes in the bottom right",
6969
TextStyle {
70-
font: font.clone().into(),
70+
font: font.clone(),
7171
font_size: 30.0,
7272
color: Color::WHITE,
7373
},
7474
),
7575
TextSection::new(
7676
"\nThis text changes in the bottom right - ",
7777
TextStyle {
78-
font: font.clone().into(),
78+
font: font.clone(),
7979
font_size: 30.0,
8080
color: Color::RED,
8181
},
8282
),
8383
TextSection::from_style(TextStyle {
84-
font: font.clone().into(),
84+
font: font.clone(),
8585
font_size: 30.0,
8686
color: Color::ORANGE_RED,
8787
}),
8888
TextSection::new(
8989
" fps, ",
9090
TextStyle {
91-
font: font.clone().into(),
91+
font: font.clone(),
9292
font_size: 30.0,
9393
color: Color::YELLOW,
9494
},
9595
),
9696
TextSection::from_style(TextStyle {
97-
font: font.clone().into(),
97+
font: font.clone(),
9898
font_size: 30.0,
9999
color: Color::GREEN,
100100
}),
101101
TextSection::new(
102102
" ms/frame",
103103
TextStyle {
104-
font: font.clone().into(),
104+
font: font.clone(),
105105
font_size: 30.0,
106106
color: Color::BLUE,
107107
},
@@ -119,7 +119,7 @@ fn infotext_system(mut commands: Commands, asset_server: Res<AssetServer>) {
119119
TextBundle::from_section(
120120
"This\ntext has\nline breaks and also a set width in the bottom left",
121121
TextStyle {
122-
font: font.into(),
122+
font,
123123
font_size: 50.0,
124124
color: Color::WHITE,
125125
},

examples/ui/text_wrap_debug.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ fn spawn(mut commands: Commands, asset_server: Res<AssetServer>) {
4444
commands.spawn(Camera2dBundle::default());
4545

4646
let text_style = TextStyle {
47-
font: asset_server.load("fonts/FiraSans-Bold.ttf").into(),
47+
font: asset_server.load("fonts/FiraSans-Bold.ttf"),
4848
font_size: 14.0,
4949
..default()
5050
};

examples/ui/transparency_ui.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
4444
parent.spawn(TextBundle::from_section(
4545
"Button 1",
4646
TextStyle {
47-
font: font_handle.clone().into(),
47+
font: font_handle.clone(),
4848
font_size: 40.0,
4949
// Alpha channel of the color controls transparency.
5050
color: Color::rgba(1.0, 1.0, 1.0, 0.2),
@@ -70,7 +70,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
7070
parent.spawn(TextBundle::from_section(
7171
"Button 2",
7272
TextStyle {
73-
font: font_handle.clone().into(),
73+
font: font_handle.clone(),
7474
font_size: 40.0,
7575
// Alpha channel of the color controls transparency.
7676
color: Color::rgba(1.0, 1.0, 1.0, 0.2),

examples/ui/ui.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
6464
TextBundle::from_section(
6565
"Text Example",
6666
TextStyle {
67-
font: asset_server.load("fonts/FiraSans-Bold.ttf").into(),
67+
font: asset_server.load("fonts/FiraSans-Bold.ttf"),
6868
font_size: 30.0,
6969
..default()
7070
},
@@ -99,7 +99,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
9999
TextBundle::from_section(
100100
"Scrolling list",
101101
TextStyle {
102-
font: asset_server.load("fonts/FiraSans-Bold.ttf").into(),
102+
font: asset_server.load("fonts/FiraSans-Bold.ttf"),
103103
font_size: 25.,
104104
..default()
105105
},
@@ -142,8 +142,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
142142
format!("Item {i}"),
143143
TextStyle {
144144
font: asset_server
145-
.load("fonts/FiraSans-Bold.ttf")
146-
.into(),
145+
.load("fonts/FiraSans-Bold.ttf"),
147146
font_size: 20.,
148147
..default()
149148
},

examples/ui/ui_scaling.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ fn setup(mut commands: Commands, asset_server: ResMut<AssetServer>) {
2828
commands.spawn(Camera2dBundle::default());
2929

3030
let text_style = TextStyle {
31-
font: asset_server.load("fonts/FiraMono-Medium.ttf").into(),
31+
font: asset_server.load("fonts/FiraMono-Medium.ttf"),
3232
font_size: 16.,
3333
color: Color::BLACK,
3434
};

examples/ui/window_fallthrough.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
3232
// Accepts a `String` or any type that converts into a `String`, such as `&str`
3333
"Hit 'P' then scroll/click around!",
3434
TextStyle {
35-
font: asset_server.load("fonts/FiraSans-Bold.ttf").into(),
35+
font: asset_server.load("fonts/FiraSans-Bold.ttf"),
3636
font_size: 100.0, // Nice and big so you can see it!
3737
..default()
3838
},

0 commit comments

Comments
 (0)