Skip to content

Commit

Permalink
docs: update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioRibera committed Apr 17, 2023
1 parent a57ed3f commit fbf7613
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
19 changes: 14 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Aviable and compatible versions
- Easy usage
- Multiple Joysticks on screen
- Multiple types of joystick behaviour
- Track events on Joystick (Press, Drag and Up)
- Support Axis block (Horizontal, Vertical or Both)

### Axis
Expand Down Expand Up @@ -187,12 +188,21 @@ struct VirtualJoystickNode {
pub behaviour: VirtualJoystickType,
}

// Event Type
pub enum VirtualJoystickEventType {
Press,
Drag,
Up
}

// EventReader
struct VirtualJoystickEvent {
/// Get ID of joystick throw event
pub fn id(&self) -> S {
self.id.clone()
}
pub fn id(&self) -> S;

/// Return the Type of Joystick Event
pub fn get_type(&self) -> VirtualJoystickEventType;

/// Raw position of point (Mouse or Touch)
pub fn value(&self) -> Vec2;

Expand All @@ -203,8 +213,7 @@ struct VirtualJoystickEvent {
pub fn axis(&self) -> Vec2;

/// Delta value snaped
/// warn: Still working, not working properly
pub fn snap_value(&self) -> Vec2;
pub fn snap_axis(&self) -> Vec2;
}

// Bundle to spawn
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ impl<S: Hash + Sync + Send + Clone + Default + Reflect + 'static> VirtualJoystic
self.delta
}

/// Return the Type of Joystick Event
pub fn get_type(&self) -> VirtualJoystickEventType {
self.event
}
Expand Down

0 comments on commit fbf7613

Please sign in to comment.