bevy/crates/bevy_picking/src
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
..
mesh_picking Fix mehses -> meshes typo (#16688) 2024-12-06 17:09:10 +00:00
backend.rs Minor docs fixes (#16347) 2024-11-13 20:42:53 +00:00
events.rs Rename Pointer<Down/Up> -> Pointer<Pressed/Released> in bevy_picking. (#16331) 2024-12-10 02:20:48 +00:00
focus.rs Rename the Pickable component and fix incorrect documentation (#15707) 2024-10-07 17:09:57 +00:00
input.rs Rename Pointer<Down/Up> -> Pointer<Pressed/Released> in bevy_picking. (#16331) 2024-12-10 02:20:48 +00:00
lib.rs Rename Pointer<Down/Up> -> Pointer<Pressed/Released> in bevy_picking. (#16331) 2024-12-10 02:20:48 +00:00
pointer.rs Rename Pointer<Down/Up> -> Pointer<Pressed/Released> in bevy_picking. (#16331) 2024-12-10 02:20:48 +00:00
window.rs Window picking (#16103) 2024-12-05 21:14:39 +00:00