1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-30 13:20:05 -04:00

Add time as input to emigui to enable animations

This commit is contained in:
Emil Ernerfeldt
2020-04-21 14:46:42 +02:00
parent 11cd1bdca3
commit 0ed578341b
4 changed files with 18 additions and 0 deletions

View File

@@ -21,6 +21,9 @@ pub struct RawInput {
/// Also known as device pixel ratio, > 1 for HDPI screens.
pub pixels_per_point: f32,
/// Time in seconds. Relative to whatever. Used for animation.
pub time: f64,
}
/// What the gui maintains
@@ -46,6 +49,9 @@ pub struct GuiInput {
/// Also known as device pixel ratio, > 1 for HDPI screens.
pub pixels_per_point: f32,
/// Time in seconds. Relative to whatever. Used for animation.
pub time: f64,
}
impl GuiInput {
@@ -62,6 +68,7 @@ impl GuiInput {
mouse_move,
screen_size: new.screen_size,
pixels_per_point: new.pixels_per_point,
time: new.time,
}
}
}