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]

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

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized, 
[src]

impl<T> Borrow<T> for T where
    T: ?Sized, 
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.