MCPcopy Create free account
hub / github.com/audulus/rui / touch

Method touch

src/modifiers.rs:182–187  ·  view source on GitHub ↗

Calls a function in response to a touch. #### Why use this? You need to know the position of the touch. You need to handle the beginning and end of the touch. #### Example ```rust use rui::*; rectangle() .touch(move |_, info| match info.state { TouchState::Begin => { println!("Touched") } TouchState::End => { println!("Released") } }); //.run(); ```

(
        self,
        f: F,
    )

Source from the content-addressed store, hash-verified

180 /// //.run();
181 /// ```
182 fn touch<A: 'static, F: Fn(&mut Context, TouchInfo) -> A + Clone + 'static>(
183 self,
184 f: F,
185 ) -> Touch<Self, TouchFunc<F>> {
186 Touch::new(self, TouchFunc { f })
187 }
188
189 /// Specify the title of the window.
190 fn window_title(self, title: &str) -> TitleView<Self> {

Callers 2

buttonFunction · 0.80
button_viewMethod · 0.80

Implementers 1

modifiers.rssrc/modifiers.rs

Calls

no outgoing calls

Tested by

no test coverage detected