diff --git a/amethyst_ui/src/event.rs b/amethyst_ui/src/event.rs index f98968e328..9c199d2706 100644 --- a/amethyst_ui/src/event.rs +++ b/amethyst_ui/src/event.rs @@ -16,7 +16,10 @@ use serde::{Deserialize, Serialize}; use std::marker::PhantomData; use winit::MouseButton; +/// An event that pertains to a specific `Entity`, for example a `UiEvent` for clicking on a widget +/// entity. pub trait TargetedEvent { + /// The `Entity` targeted by the event. fn get_target(&self) -> Entity; } diff --git a/amethyst_ui/src/lib.rs b/amethyst_ui/src/lib.rs index fff86211ea..d92cf7b5b6 100644 --- a/amethyst_ui/src/lib.rs +++ b/amethyst_ui/src/lib.rs @@ -18,7 +18,9 @@ pub use self::{ UiButtonBuilderResources, UiButtonSystem, UiButtonSystemDesc, }, drag::{DragWidgetSystemDesc, Draggable}, - event::{targeted, targeted_below, Interactable, UiEvent, UiEventType, UiMouseSystem}, + event::{ + targeted, targeted_below, Interactable, TargetedEvent, UiEvent, UiEventType, UiMouseSystem, + }, event_retrigger::{ EventReceiver, EventRetrigger, EventRetriggerSystem, EventRetriggerSystemDesc, }, diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index e275dea07e..5dd1ce8825 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -15,6 +15,8 @@ The format is based on [Keep a Changelog][kc], and this project adheres to ### Changed +- Re-export `TargetedEvent` from amethyst_ui. ([#2114]) + ### Deprecated ### Removed @@ -23,6 +25,8 @@ The format is based on [Keep a Changelog][kc], and this project adheres to ### Security +[#2114]: https://github.com/amethyst/amethyst/pull/2114 + ## [0.14.0] - 2020-01-30 ### Added