Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/fonts/Leland.otf
Binary file not shown.
3 changes: 3 additions & 0 deletions neothesia-core/src/font_system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ pub fn font_system() -> Rc<RefCell<FontSystem>> {
glyphon::fontdb::Source::Binary(Arc::new(include_bytes!(
"../../assets/fonts/bootstrap-icons.ttf"
))),
glyphon::fontdb::Source::Binary(Arc::new(include_bytes!(
"../../assets/fonts/Leland.otf"
))),
])))
})
.clone()
Expand Down
98 changes: 98 additions & 0 deletions neothesia/src/scene/playing_scene/top_bar/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,104 @@ impl TopBar {
pub fn ui(this: &mut PlayingScene, ctx: &mut Context) {
let mut ui = std::mem::replace(&mut this.nuon, nuon::Ui::new());

nuon::translate().y(100.0).build(&mut ui, |ui| {
let spacing = 15.0;
let half_spacing = spacing / 2.0;
let y = 50.0;
let x = 40.0;

let color = [0; 3];

nuon::quad()
.color([255; 3])
.pos(0.0, 0.0)
.size(250.0, 130.0)
.border_radius([0.0, 10.0, 10.0, 0.0])
.build(ui);

{
let y = y + 39.0;

for id in 0..5 {
nuon::quad()
.y(y - id as f32 * spacing)
.height(1.0)
.width(250.0)
.color(color)
.build(ui);
}
}

let base = || half_spacing * 4.0;
let pitch_y = |pitch: u8| base() - half_spacing * pitch as f32;

nuon::label()
.text("")
.color(color)
.font_family("Leland")
.font_size(60.0)
.x(x)
.y(y)
.build(ui);

// nuon::label()
// .text("")
// .color(color)
// .font_family("Leland")
// .font_size(60.0)
// .x(x + 60.0)
// .y(y + spacing / 2.0)
// .build(ui);

let flat = "";
let sharp = "";

{
let y = y + pitch_y(9);

nuon::label()
.text(sharp)
.color(color)
.font_family("Leland")
.font_size(60.0)
.x(x + 60.0 + 22.0)
.y(y)
.build(ui);
}

// for pitch in 0..10 {
// if pitch == 0 {
// let y = y + 39.0 + spacing;
// nuon::quad()
// .x(x + 60.0 + 20.0 - 10.0)
// .y(y)
// .height(1.0)
// .width(30.0)
// .color(color)
// .build(ui);
// }
//
// let y = y + pitch_y(pitch);
//
// nuon::label()
// .text(sharp)
// .color(color)
// .font_family("Leland")
// .font_size(60.0)
// .x(x + 60.0 + 22.0 * (pitch % 2) as f32)
// .y(y)
// .build(ui);
// }

// nuon::label()
// .text("")
// .font_family("Leland")
// .font_size(60.0)
// .x(100.0)
// .y(y)
// .build(&mut ui);
});

nuon::translate()
.y(this.top_bar.topbar_expand_animation.animate_bool(
-75.0 + 5.0,
Expand Down