latch input
This commit is contained in:
@@ -9,7 +9,7 @@ pub struct Button {
|
||||
impl Button {
|
||||
pub fn begin_frame(&mut self, is_down_now: bool) {
|
||||
let was_down = self.down;
|
||||
self.down = is_down_now;
|
||||
self.down = is_down_now.clone();
|
||||
|
||||
self.pressed = !was_down && self.down;
|
||||
self.released = was_down && !self.down;
|
||||
|
||||
Reference in New Issue
Block a user