Interface on the pixel grid: a virtual screen of whole multiples of the world's rows, sharp-scaled to every device; compact title menu on short screens
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
aa39e66da9
commit
e7fc0a4751
5 files changed
+142
-66
No files matched your search
@@ -926,6 +926,7 @@ async fn main() {
|
||||
}
|
||||
if app.editor.is_some() && !app.editor_testing {
|
||||
editor_frame(&mut app, &mut menu, &mut cloud, &mut r3d, &gfx, &mut ui, dt, now);
|
||||
ui::end_frame();
|
||||
next_frame().await;
|
||||
continue;
|
||||
}
|
||||
@@ -945,6 +946,12 @@ async fn main() {
|
||||
_ => auto_touch,
|
||||
};
|
||||
ui::set_touch(touch_mode);
|
||||
// pixel look: the interface on a virtual screen whose pixels are whole parts of the world's
|
||||
let rows = if [270, 360, 480].contains(&app.settings.pixel_rows) { app.settings.pixel_rows as u32 } else { 360 };
|
||||
// the interface needs room: the smallest whole multiple of the world's rows with at least
|
||||
// 900 rows on a desktop (360 -> 1080) and 540 on a touch screen (360 -> 720)
|
||||
let need: u32 = if touch_mode { 540 } else { 900 };
|
||||
ui::set_virtual_rows(rows * need.div_ceil(rows));
|
||||
if touch_mode {
|
||||
// the pointer is the finger, or the position of this frame's gesture
|
||||
let gpos = gestures.iter().rev().find_map(|g| match *g {
|
||||
@@ -1153,6 +1160,7 @@ async fn main() {
|
||||
}
|
||||
let p = mouse_position();
|
||||
draw_frame(&mut app, &gfx, &mut r3d, &mut ui, &mut menu, &cloud, &inp, p, false, now);
|
||||
ui::end_frame();
|
||||
next_frame().await;
|
||||
continue;
|
||||
}
|
||||
@@ -2056,6 +2064,7 @@ app.pending_briefing = briefing_of(&campaign, i);
|
||||
voice.update(now, if app.settings.muted { 0.0 } else { app.settings.volume });
|
||||
|
||||
draw_frame(&mut app, &gfx, &mut r3d, &mut ui, &mut menu, &cloud, &inp, (mx, my), touch_mode, now);
|
||||
ui::end_frame();
|
||||
next_frame().await
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user