From 26a2b2f0d63dc5fdd40bde1a39100acb7762bf29 Mon Sep 17 00:00:00 2001 From: ickshonpe Date: Fri, 24 Mar 2023 20:43:55 +0000 Subject: [PATCH] changes: * Added `with_flip_x` and `with_flip_y` methods to `UiImage` that flip the image in the respective axis. --- crates/bevy_ui/src/ui_node.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/crates/bevy_ui/src/ui_node.rs b/crates/bevy_ui/src/ui_node.rs index ce5334b47b00d..66eb0e12d2da3 100644 --- a/crates/bevy_ui/src/ui_node.rs +++ b/crates/bevy_ui/src/ui_node.rs @@ -758,6 +758,20 @@ impl UiImage { ..Default::default() } } + + /// flip the image along its x-axis + #[must_use] + pub const fn with_flip_x(mut self) -> Self { + self.flip_x = true; + self + } + + /// flip the image along its y-axis + #[must_use] + pub const fn with_flip_y(mut self) -> Self { + self.flip_y = true; + self + } } impl From> for UiImage {