bevy/crates/bevy_picking
Harun Ibram ad4144ad7a
Rename Pointer<Down/Up> -> Pointer<Pressed/Released> in bevy_picking. (#16331)
# Objective
Fixes #16192 

## Solution
I renamed the Pointer<Down/Up> to <Pressed/Released> and then I resolved
all the errors.
Renamed variables like "is_down" to "is_pressed" to maintain
consistency.
Modified the docs in places where 'down/up' were used to maintain
consistency.

## Testing

I haven't tested this in any way beside the checks from rust analyzer
and the examples in the examples/ directory.

---

## Migration Guide

### `bevy_picking/src/pointer.rs`:
#### `enum PressDirection`:

- `PressDirection::Down` changes to `PressDirection::Pressed`.
- `PressDirection::Up` changes to `PressDirection::Released`.

	These changes are also relevant when working with `enum PointerAction`

### `bevy_picking/src/events.rs`:
Clicking and pressing Events in events.rs categories change from [Down],
[Up], [Click] to [Pressed], [Released], [Click].

- `struct Down` changes to `struct Pressed` - fires when a pointer
button is pressed over the 'target' entity.
- `struct Up` changes to `struct Released` - fires when a pointer button
is released over the 'target' entity.
- `struct Click` now fires when a pointer sends a Pressed event followed
by a Released event on the same 'target'.
- `struct DragStart` now fires when the 'target' entity receives a
pointer Pressed event followed by a pointer Move event.
- `struct DragEnd` now fires when the 'target' entity is being dragged
and receives a pointer Released event.
- `PickingEventWriters<'w>::down_events: EventWriter<'w, Pointer<Down>>`
changes to `PickingEventWriters<'w>::pressed_events: EventWriter<'w,
Pointer<Pressed>>`.
- `PickingEventWriters<'w>::up_events changes to
PickingEventWriters<'w>::released_events`.

---------

Co-authored-by: Harun Ibram <harun.ibram@outlook.com>
Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
2024-12-10 02:20:48 +00:00
..
src Rename Pointer<Down/Up> -> Pointer<Pressed/Released> in bevy_picking. (#16331) 2024-12-10 02:20:48 +00:00
Cargo.toml Fix the picking backend features not actually disabling the features (#16470) 2024-11-22 18:14:16 +00:00
README.md Upstream CorePlugin from bevy_mod_picking (#13677) 2024-06-15 11:59:57 +00:00

Bevy Picking