Skip to content

Commit 97f97a0

Browse files
Added more stuff to the level page
I think level downloading is pretty much done now. Will I do level uploading now? No!
1 parent 9a0e991 commit 97f97a0

File tree

2 files changed

+90
-0
lines changed

2 files changed

+90
-0
lines changed

Resources/star.png

92.1 KB
Loading

src/main.rs

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,8 @@ async fn main() {
424424
.await.expect("Failed to load background texture");
425425
let grnd_texture = load_texture("./Resources/ground.png")
426426
.await.expect("Failed to load ground texture");
427+
let star_texture = load_texture("./Resources/star.png")
428+
.await.expect("Failed to load star texture");
427429

428430
let mut difficulties: Vec<Texture2D> = vec![];
429431

@@ -1772,6 +1774,94 @@ async fn main() {
17721774
}
17731775
);
17741776

1777+
draw_text_pro(
1778+
&online_level_name,
1779+
screen_width() / 2.0 - measure_text_ex(&online_level_name, 50, &font) / 2.0,
1780+
150.0,
1781+
50,
1782+
WHITE,
1783+
&font
1784+
);
1785+
1786+
draw_rectangle(
1787+
screen_width() / 2.0 - 394.0,
1788+
screen_height() / 2.0 + 100.0,
1789+
789.0,
1790+
50.0,
1791+
Color::from_rgba(
1792+
50,
1793+
50,
1794+
50,
1795+
100
1796+
)
1797+
);
1798+
1799+
draw_text_pro(
1800+
&online_level_desc,
1801+
screen_width() / 2.0 - measure_text_ex(&online_level_desc, 20, &font) / 2.0,
1802+
screen_height() / 2.0 + 100.0 + 35.0,
1803+
20,
1804+
WHITE,
1805+
&font
1806+
);
1807+
1808+
let weird_vec2_idk: Vec2 = if online_level_diff == 0 { Vec2::new(10.0, 60.0) } else { Vec2::new(-50.0, 0.0) };
1809+
draw_texture_ex(
1810+
&difficulties[online_level_diff as usize],
1811+
weird_vec2_idk.x,
1812+
weird_vec2_idk.y,
1813+
WHITE,
1814+
DrawTextureParams {
1815+
dest_size: Some(vec2(
1816+
difficulties[online_level_diff as usize].width() * if online_level_diff == 0 { 0.3 } else { 0.2 },
1817+
difficulties[online_level_diff as usize].height() * if online_level_diff == 0 { 0.3 } else { 0.2 }
1818+
)),
1819+
source: None,
1820+
rotation: 0.0,
1821+
flip_x: false,
1822+
flip_y: false,
1823+
pivot: None
1824+
}
1825+
);
1826+
1827+
if online_level_rated {
1828+
draw_text_pro(
1829+
&format!("{}", online_level_diff),
1830+
175.0,
1831+
300.0,
1832+
30,
1833+
WHITE,
1834+
&font
1835+
);
1836+
1837+
draw_texture_ex(
1838+
&star_texture,
1839+
30.0,
1840+
175.0,
1841+
WHITE,
1842+
DrawTextureParams {
1843+
dest_size: Some(vec2(
1844+
star_texture.width() * 0.13,
1845+
star_texture.height() * 0.13
1846+
)),
1847+
source: None,
1848+
rotation: 0.0,
1849+
flip_x: false,
1850+
flip_y: false,
1851+
pivot: None
1852+
}
1853+
);
1854+
}
1855+
1856+
draw_text_pro(
1857+
&online_level_creator,
1858+
screen_width() / 2.0 - measure_text_ex(&online_level_creator, 50, &font) / 2.0,
1859+
80.0,
1860+
50,
1861+
WHITE,
1862+
&font
1863+
);
1864+
17751865
back_button.draw(false, None, 1.0, false, &font);
17761866
level_play_button.draw(false, None, 1.0, false, &font);
17771867
}

0 commit comments

Comments
 (0)