Skip to content

Commit

Permalink
docs: add temporary solution for 8322 bevy issue
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioRibera committed Apr 7, 2023
1 parent 31e4963 commit 55f56a7
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,14 @@ Add to Cargo.toml
bevy = "0.10.1"
virtual_joystick = "*" # Add your version
```
To solve [sizing issue](#user-content-issues)
```
[patch.crates-io]
android-activity = { git = "https://github.com/MarijnS95/android-activity/", branch = "na-resize"}
```

The minimal requirement:
```rs
```rust
use bevy::prelude::*;
// import crate
use virtual_joystick::*;
Expand All @@ -59,7 +64,7 @@ fn main() {
```

Create Joystick
```rs
```rust
#[bevy_main]
fn main() {
App::new()
Expand Down Expand Up @@ -105,7 +110,7 @@ fn create_scene(mut cmd: Commands, asset_server: Res<AssetServer>) {
```

Use variable generated by Joystick
```rs
```rust

fn update_joystick(
mut joystick: EventReader<VirtualJoystickEvent>,
Expand All @@ -128,7 +133,7 @@ fn update_joystick(

# Types

```rs
```rust
// Resource
enum VirtualJoystickAxis {
Both, // Default
Expand Down Expand Up @@ -199,7 +204,14 @@ struct VirtualJoystickBundle {
}
```

# Issues
- [Sizing problem between desktop and mobile (UI/2D)](https://github.com/bevyengine/bevy/issues/8322)
> **Note**: Temporary solution, add this to your Cargo.toml
```rs
[patch.crates-io]
android-activity = { git = "https://github.com/MarijnS95/android-activity/", branch = "na-resize"}
```

# TODOs
- Add more documentation
- Fix movement of Dynamic joystick
- Fix size on mobile build (please check this [issue](https://github.com/bevyengine/bevy/issues/8322))

0 comments on commit 55f56a7

Please sign in to comment.