Struct macroquad_virtual_joystick::JoystickElement [−][src]
pub struct JoystickElement { /* fields omitted */ }element of the Joystick
can be used for the background or the knob
Implementations
impl JoystickElement[src]
impl JoystickElement[src]pub fn new(x: f32, y: f32, radius: f32, color: Color) -> Self[src]
create a new JoystickElement
Examples
use macroquad::prelude::Color; use macroquad_virtual_joystick::JoystickElement; let center_x = 50.0; let center_y = 100.0; let radius = 30.0; let background_color = Color::from_rgba(255, 0, 0, 255); let background = JoystickElement::new( center_x, center_y, radius, background_color, );
pub fn render(&self)[src]
render the element
Auto Trait Implementations
impl RefUnwindSafe for JoystickElement
impl RefUnwindSafe for JoystickElementimpl Send for JoystickElement
impl Send for JoystickElementimpl Sync for JoystickElement
impl Sync for JoystickElementimpl Unpin for JoystickElement
impl Unpin for JoystickElementimpl UnwindSafe for JoystickElement
impl UnwindSafe for JoystickElement