MCPcopy Create free account
hub / github.com/Bloom-Engine/engine / set_touch

Method set_touch

native/shared/src/input.rs:231–239  ·  view source on GitHub ↗

Touch

(&mut self, index: usize, x: f64, y: f64, active: bool)

Source from the content-addressed store, hash-verified

229
230 // Touch
231 pub fn set_touch(&mut self, index: usize, x: f64, y: f64, active: bool) {
232 if index < MAX_TOUCH_POINTS {
233 self.touch_points[index] = TouchPoint { x, y, active };
234 if active {
235 self.touch_pending_release[index] = false;
236 }
237 self.touch_count = self.touch_points.iter().filter(|t| t.active).count();
238 }
239 }
240 /// Deferred release: keeps the slot active for the current frame and
241 /// clears it at `end_frame`. Call from platform event loops on ACTION_UP
242 /// so a DOWN+UP that falls inside one frame remains visible to the game.

Callers 3

bloom_android_on_touchFunction · 0.80
handle_touchesFunction · 0.80
handle_touchesFunction · 0.80

Calls 2

iterMethod · 0.80
countMethod · 0.45

Tested by

no test coverage detected