Skip to content

Commit

Permalink
brought parentheses back and fix for white color
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickChodowski committed Jul 22, 2024
1 parent 6a8046b commit c13b4cb
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion examples/simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ fn create_scene(mut cmd: Commands, asset_server: Res<AssetServer>) {
bottom: Val::Percent(15.),
..default()
},
JoystickFloating,
(JoystickFloating),
NoAction,
);
}
Expand Down
2 changes: 1 addition & 1 deletion examples/simple_mobile/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ fn create_scene(mut cmd: Commands, asset_server: Res<AssetServer>) {
bottom: Val::Percent(15.),
..default()
},
JoystickFloating,
(JoystickFloating),
NoAction,
);
}
Expand Down
2 changes: 1 addition & 1 deletion examples/tint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ fn create_scene(mut cmd: Commands, asset_server: Res<AssetServer>) {
bottom: Val::Percent(15.),
..default()
},
JoystickFloating,
(JoystickFloating),
TintAction {
down: Color::srgba(1.0, 0.0, 0.0, 1.0), // Red
up: Color::srgba(0.0, 1.0, 0.0, 0.5), // Green
Expand Down
20 changes: 10 additions & 10 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,30 +122,30 @@ pub fn create_joystick<I: VirtualJoystickID>(
);
let spawn = spawn.with_children(|parent| {
parent.spawn((
VirtualJoystickUIKnob,
VirtualJoystickUIBackground,
ImageBundle {
image: knob_img.into(),
image: background_img.into(),
style: Style {
position_type: PositionType::Absolute,
width: Val::Px(knob_size.x),
height: Val::Px(knob_size.y),
width: Val::Px(background_size.x),
height: Val::Px(background_size.y),
..default()
},
background_color: knob_color.unwrap_or(Color::WHITE).into(),
background_color: background_color.unwrap_or(Color::WHITE.with_alpha(0.0)).into(),
..default()
},
));
parent.spawn((
VirtualJoystickUIBackground,
VirtualJoystickUIKnob,
ImageBundle {
image: background_img.into(),
image: knob_img.into(),
style: Style {
position_type: PositionType::Absolute,
width: Val::Px(background_size.x),
height: Val::Px(background_size.y),
width: Val::Px(knob_size.x),
height: Val::Px(knob_size.y),
..default()
},
background_color: background_color.unwrap_or(Color::WHITE).into(),
background_color: knob_color.unwrap_or(Color::WHITE.with_alpha(0.0)).into(),
..default()
},
));
Expand Down

0 comments on commit c13b4cb

Please sign in to comment.