diff --git a/examples/every_option.rs b/examples/every_option.rs index c64e133a1d8debda4edb13a9a155e71887a29d11..05b7473901c7fcacc3ad15f2e58473a9a4fc218a 100644 --- a/examples/every_option.rs +++ b/examples/every_option.rs @@ -7,7 +7,7 @@ struct TextChangeTimer(pub Timer); fn setup(mut commands: Commands, mut font_system: ResMut<CosmicFontSystem>) { commands.spawn(Camera2dBundle::default()); - let attrs = Attrs::new().color(bevy_color_to_cosmic(Color::rgb(0.27, 0.27, 0.27))); + let attrs = Attrs::new().color(Color::rgb(0.27, 0.27, 0.27).to_cosmic()); let editor = commands .spawn(CosmicEditBundle { diff --git a/examples/font_per_widget.rs b/examples/font_per_widget.rs index a599c689134616c4a823ae38f127465e54af8639..a935e733dabb003bfe7daad77cd60e9298a65e70 100644 --- a/examples/font_per_widget.rs +++ b/examples/font_per_widget.rs @@ -66,31 +66,28 @@ fn setup(mut commands: Commands, mut font_system: ResMut<CosmicFontSystem>) { .style(FontStyle::Italic), ), ("\n", attrs), - ("R", attrs.color(bevy_color_to_cosmic(Color::RED))), - ("A", attrs.color(bevy_color_to_cosmic(Color::ORANGE))), - ("I", attrs.color(bevy_color_to_cosmic(Color::YELLOW))), - ("N", attrs.color(bevy_color_to_cosmic(Color::GREEN))), - ("B", attrs.color(bevy_color_to_cosmic(Color::BLUE))), - ("O", attrs.color(bevy_color_to_cosmic(Color::INDIGO))), - ("W ", attrs.color(bevy_color_to_cosmic(Color::PURPLE))), - ("Red ", attrs.color(bevy_color_to_cosmic(Color::RED))), - ("Orange ", attrs.color(bevy_color_to_cosmic(Color::ORANGE))), - ("Yellow ", attrs.color(bevy_color_to_cosmic(Color::YELLOW))), - ("Green ", attrs.color(bevy_color_to_cosmic(Color::GREEN))), - ("Blue ", attrs.color(bevy_color_to_cosmic(Color::BLUE))), - ("Indigo ", attrs.color(bevy_color_to_cosmic(Color::INDIGO))), - ("Violet ", attrs.color(bevy_color_to_cosmic(Color::PURPLE))), - ("U", attrs.color(bevy_color_to_cosmic(Color::PURPLE))), - ("N", attrs.color(bevy_color_to_cosmic(Color::INDIGO))), - ("I", attrs.color(bevy_color_to_cosmic(Color::BLUE))), - ("C", attrs.color(bevy_color_to_cosmic(Color::GREEN))), - ("O", attrs.color(bevy_color_to_cosmic(Color::YELLOW))), - ("R", attrs.color(bevy_color_to_cosmic(Color::ORANGE))), - ("N", attrs.color(bevy_color_to_cosmic(Color::RED))), - ( - "生活,삶,जिंदगी 😀 FPS", - attrs.color(bevy_color_to_cosmic(Color::RED)), - ), + ("R", attrs.color(Color::RED.to_cosmic())), + ("A", attrs.color(Color::ORANGE.to_cosmic())), + ("I", attrs.color(Color::YELLOW.to_cosmic())), + ("N", attrs.color(Color::GREEN.to_cosmic())), + ("B", attrs.color(Color::BLUE.to_cosmic())), + ("O", attrs.color(Color::INDIGO.to_cosmic())), + ("W ", attrs.color(Color::PURPLE.to_cosmic())), + ("Red ", attrs.color(Color::RED.to_cosmic())), + ("Orange ", attrs.color(Color::ORANGE.to_cosmic())), + ("Yellow ", attrs.color(Color::YELLOW.to_cosmic())), + ("Green ", attrs.color(Color::GREEN.to_cosmic())), + ("Blue ", attrs.color(Color::BLUE.to_cosmic())), + ("Indigo ", attrs.color(Color::INDIGO.to_cosmic())), + ("Violet ", attrs.color(Color::PURPLE.to_cosmic())), + ("U", attrs.color(Color::PURPLE.to_cosmic())), + ("N", attrs.color(Color::INDIGO.to_cosmic())), + ("I", attrs.color(Color::BLUE.to_cosmic())), + ("C", attrs.color(Color::GREEN.to_cosmic())), + ("O", attrs.color(Color::YELLOW.to_cosmic())), + ("R", attrs.color(Color::ORANGE.to_cosmic())), + ("N", attrs.color(Color::RED.to_cosmic())), + ("生活,삶,जिंदगी 😀 FPS", attrs.color(Color::RED.to_cosmic())), ]; let cosmic_edit_1 = commands @@ -106,7 +103,7 @@ fn setup(mut commands: Commands, mut font_system: ResMut<CosmicFontSystem>) { let mut attrs_2 = Attrs::new(); attrs_2 = attrs_2.family(Family::Name("Times New Roman")); - attrs_2.color_opt = Some(bevy_color_to_cosmic(Color::PURPLE)); + attrs_2.color_opt = Some(Color::PURPLE.to_cosmic()); let cosmic_edit_2 = commands .spawn(CosmicEditBundle { diff --git a/examples/image_background.rs b/examples/image_background.rs index c80bc8f29e294e970d3f6f688ec4fe8d1ab1cf57..708611ba768f1d417f80b3628cbd1000dd9b4f99 100644 --- a/examples/image_background.rs +++ b/examples/image_background.rs @@ -9,7 +9,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) { let editor = commands .spawn(CosmicEditBundle { default_attrs: DefaultAttrs(AttrsOwned::new( - Attrs::new().color(bevy_color_to_cosmic(Color::GREEN)), + Attrs::new().color(Color::GREEN.to_cosmic()), )), background_image: CosmicBackgroundImage(Some(bg_image_handle)), ..default() diff --git a/examples/multiple_sprites.rs b/examples/multiple_sprites.rs index 2bca069215945b0bd56b129c129e53c67a54f216..509f238b1a01b3b2ebaea3aac890e348423c4463 100644 --- a/examples/multiple_sprites.rs +++ b/examples/multiple_sprites.rs @@ -18,7 +18,7 @@ fn setup( let mut attrs = Attrs::new(); attrs = attrs.family(Family::Name("Victor Mono")); - attrs = attrs.color(bevy_color_to_cosmic(Color::PURPLE)); + attrs = attrs.color(Color::PURPLE.to_cosmic()); commands.spawn(CosmicEditBundle { fill_color: CosmicBackgroundColor(Color::ALICE_BLUE), diff --git a/examples/placeholder.rs b/examples/placeholder.rs index 64192ad6f92d693aaf3747d8856b9d1924a68816..61fcd2b4a5a861f0ec0dc149dc757853843a7c43 100644 --- a/examples/placeholder.rs +++ b/examples/placeholder.rs @@ -23,10 +23,7 @@ fn setup(mut commands: Commands, mut font_system: ResMut<CosmicFontSystem>) { .with_rich_text(&mut font_system, vec![("", attrs)], attrs), ..default() }, - Placeholder::new( - "Placeholder", - attrs.color(bevy_color_to_cosmic(Color::GRAY)), - ), + Placeholder::new("Placeholder", attrs.color(Color::GRAY.to_cosmic())), )) .id(); diff --git a/examples/readonly.rs b/examples/readonly.rs index b339fa9c6b8bd76561a00d5803eca2587ce1472d..9a817fcfe48b48e1ced0ef013ec1ea7f4c1952f5 100644 --- a/examples/readonly.rs +++ b/examples/readonly.rs @@ -17,7 +17,7 @@ fn setup(mut commands: Commands, mut font_system: ResMut<CosmicFontSystem>) { let mut attrs = Attrs::new(); attrs = attrs.family(Family::Name("Victor Mono")); - attrs = attrs.color(bevy_color_to_cosmic(Color::PURPLE)); + attrs = attrs.color(Color::PURPLE.to_cosmic()); // spawn editor let cosmic_edit = commands diff --git a/examples/sprite_and_ui_clickable.rs b/examples/sprite_and_ui_clickable.rs index 1d1325387c93402057a03a7a327e3198cc47b594..76c8cd70b36e677a23c6023d576119dd84e7957f 100644 --- a/examples/sprite_and_ui_clickable.rs +++ b/examples/sprite_and_ui_clickable.rs @@ -8,7 +8,7 @@ fn setup(mut commands: Commands) { let ui_editor = commands .spawn(CosmicEditBundle { default_attrs: DefaultAttrs(AttrsOwned::new( - Attrs::new().color(bevy_color_to_cosmic(Color::GREEN)), + Attrs::new().color(Color::GREEN.to_cosmic()), )), max_lines: MaxLines(1), mode: CosmicWrap::InfiniteLine, diff --git a/src/buffer.rs b/src/buffer.rs index 782c0ffe8b4ceb78f2e216186142486e45cc4039..308705a8c49de5198ee5379179f6d2facc3436c6 100644 --- a/src/buffer.rs +++ b/src/buffer.rs @@ -5,7 +5,7 @@ use bevy::{prelude::*, window::PrimaryWindow}; #[derive(SystemSet, Debug, Clone, PartialEq, Eq, Hash)] pub struct BufferSet; -pub struct BufferPlugin; +pub(crate) struct BufferPlugin; impl Plugin for BufferPlugin { fn build(&self, app: &mut App) { @@ -53,6 +53,7 @@ impl BufferExtras for Buffer { } } +/// Component wrapper for [`Buffer`] #[derive(Component, Deref, DerefMut)] pub struct CosmicBuffer(pub Buffer); diff --git a/src/cursor.rs b/src/cursor.rs index e14720948a932036f3b4c9a720b50386070e89e0..f7c5056b8423b59446f4bb2335526adee1345996 100644 --- a/src/cursor.rs +++ b/src/cursor.rs @@ -1,10 +1,14 @@ +// This will all be rewritten soon, looking toward per-widget cursor control +// Rewrite should address issue #93 too + use crate::*; use bevy::{input::mouse::MouseMotion, prelude::*, window::PrimaryWindow}; +/// System set for mouse cursor systems. Runs in [`Update`] #[derive(SystemSet, Debug, Clone, PartialEq, Eq, Hash)] pub struct CursorSet; -pub struct CursorPlugin { +pub(crate) struct CursorPlugin { pub change_cursor: CursorConfig, } @@ -34,6 +38,7 @@ pub struct TextHoverIn; #[derive(Event)] pub struct TextHoverOut; +/// Switches mouse cursor icon when hover events are received pub fn change_cursor( evr_hover_in: EventReader<TextHoverIn>, evr_hover_out: EventReader<TextHoverOut>, @@ -67,6 +72,8 @@ type CameraQuery<'a, 'b, 'c, 'd> = #[cfg(not(feature = "multicam"))] type CameraQuery<'a, 'b, 'c, 'd> = Query<'a, 'b, (&'c Camera, &'d GlobalTransform)>; +/// Sprite widget mouse cursor hover detection system. Sends [`TextHoverIn`] and [`TextHoverOut`] +/// events. pub fn hover_sprites( windows: Query<&Window, With<PrimaryWindow>>, mut cosmic_edit_query: Query<(&mut Sprite, &Visibility, &GlobalTransform), With<CosmicBuffer>>, @@ -112,6 +119,8 @@ pub fn hover_sprites( *last_hovered = *hovered; } +/// UI widget mouse cursor hover detection system. Sends [`TextHoverIn`] and [`TextHoverOut`] +/// events. pub fn hover_ui( mut interaction_query: Query<&Interaction, (Changed<Interaction>, With<CosmicSource>)>, mut evw_hover_in: EventWriter<TextHoverIn>, diff --git a/src/events.rs b/src/events.rs index a2eb9d1167f0504688792e6c96a6588ff3f164d2..e9ecea551bfc1fc07505ff49e6c83b3be1300a98 100644 --- a/src/events.rs +++ b/src/events.rs @@ -3,7 +3,7 @@ use bevy::prelude::*; /// Registers internal events -pub struct EventsPlugin; +pub(crate) struct EventsPlugin; impl Plugin for EventsPlugin { fn build(&self, app: &mut App) { diff --git a/src/focus.rs b/src/focus.rs index a78079bc09810410f05146bbee86be256ed57a65..522b18e34b0f7041e3fa907fd26f308f727c22b4 100644 --- a/src/focus.rs +++ b/src/focus.rs @@ -6,7 +6,7 @@ use cosmic_text::{Edit, Editor}; #[derive(SystemSet, Debug, Clone, PartialEq, Eq, Hash)] pub struct FocusSet; -pub struct FocusPlugin; +pub(crate) struct FocusPlugin; impl Plugin for FocusPlugin { fn build(&self, app: &mut App) { diff --git a/src/input.rs b/src/input.rs index d1a738e9efcd41d4304a56379d66475592c9437d..7d292ee6565804d923b8b5e6c84b8ebfbd7d481e 100644 --- a/src/input.rs +++ b/src/input.rs @@ -19,10 +19,11 @@ use wasm_bindgen::prelude::*; #[cfg(target_arch = "wasm32")] use wasm_bindgen_futures::JsFuture; +/// System set for mouse and keyboard input events. Runs in [`PreUpdate`] and [`Update`] #[derive(SystemSet, Debug, Clone, PartialEq, Eq, Hash)] pub struct InputSet; -pub struct InputPlugin; +pub(crate) struct InputPlugin; impl Plugin for InputPlugin { fn build(&self, app: &mut App) { diff --git a/src/lib.rs b/src/lib.rs index 49348cea4d473c48be945fee1d42e6e88045c4cb..3c425698f73527e92611121aaf3b3181be8ba8d1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -18,6 +18,7 @@ use bevy::{prelude::*, transform::TransformSystem}; pub use buffer::*; pub use cosmic_edit::*; +#[doc(no_inline)] pub use cosmic_text::{ Action, Attrs, AttrsOwned, Buffer, Color as CosmicColor, Cursor, Edit, Editor, Family, FontSystem, Metrics, Shaping, Style as FontStyle, Weight as FontWeight, diff --git a/src/password.rs b/src/password.rs index f84819e1504de9eba27eb24a7655cc978a59c124..5dcf3d573eadcd56a15b805ade3a54d4797433ee 100644 --- a/src/password.rs +++ b/src/password.rs @@ -3,8 +3,9 @@ use bevy::prelude::*; use cosmic_text::{Cursor, Edit, Selection, Shaping}; use unicode_segmentation::UnicodeSegmentation; -pub struct PasswordPlugin; +pub(crate) struct PasswordPlugin; +/// System set for password blocking systems. Runs in [`PostUpdate`] #[derive(SystemSet, Debug, Clone, PartialEq, Eq, Hash)] pub struct PasswordSet; @@ -27,6 +28,35 @@ impl Plugin for PasswordPlugin { } } +/// Component to be added to an entity with a [`CosmicEditBundle`] to block contents with a +/// password blocker glyph +/// +/// ``` +/// # use bevy::prelude::*; +/// # use bevy_cosmic_edit::*; +/// # +/// # fn setup(mut commands: Commands) { +/// // Create a new cosmic bundle +/// commands.spawn((CosmicEditBundle { +/// sprite_bundle: SpriteBundle { +/// sprite: Sprite { +/// custom_size: Some(Vec2::new(300.0, 40.0)), +/// ..default() +/// }, +/// ..default() +/// }, +/// ..default() +/// }, +/// Password::default() +/// )); +/// # } +/// # +/// # fn main() { +/// # App::new() +/// # .add_plugins(MinimalPlugins) +/// # .add_plugins(CosmicEditPlugin::default()) +/// # .add_systems(Startup, setup); +/// # } #[derive(Component)] pub struct Password { real_text: String, @@ -42,6 +72,13 @@ impl Default for Password { } } +impl Password { + /// New password component with custom blocker glyph + pub fn new(glyph: char) -> Self { + Self { glyph, ..default() } + } +} + fn hide_password_text( mut q: Query<( &mut Password, diff --git a/src/placeholder.rs b/src/placeholder.rs index d956760bb5ac783dd360b0fe899d804901dc7ad8..0fc5b21be94a5cb2c4283fd3e95d16491e08fbbf 100644 --- a/src/placeholder.rs +++ b/src/placeholder.rs @@ -2,14 +2,45 @@ use crate::*; use bevy::prelude::*; use cosmic_text::{Attrs, Edit}; +/// Component to be added to an entity with a [`CosmicEditBundle`] add placeholder text +/// +/// ``` +/// # use bevy::prelude::*; +/// # use bevy_cosmic_edit::*; +/// # +/// # fn setup(mut commands: Commands) { +/// // Create a new cosmic bundle +/// commands.spawn((CosmicEditBundle { +/// sprite_bundle: SpriteBundle { +/// sprite: Sprite { +/// custom_size: Some(Vec2::new(300.0, 40.0)), +/// ..default() +/// }, +/// ..default() +/// }, +/// ..default() +/// }, +/// Placeholder::new("Email", Attrs::new().color(Color::GRAY.to_cosmic()), +/// )); +/// # } +/// # +/// # fn main() { +/// # App::new() +/// # .add_plugins(MinimalPlugins) +/// # .add_plugins(CosmicEditPlugin::default()) +/// # .add_systems(Startup, setup); +/// # } #[derive(Component)] pub struct Placeholder { + /// Placeholder text content pub text: &'static str, + /// Text attributes for placeholder text pub attrs: Attrs<'static>, active: bool, } impl Placeholder { + /// Create a new [`Placeholder`] component with given text and attributes pub fn new(text: impl Into<&'static str>, attrs: Attrs<'static>) -> Self { Self { active: false, @@ -23,7 +54,7 @@ impl Placeholder { } } -pub struct PlaceholderPlugin; +pub(crate) struct PlaceholderPlugin; impl Plugin for PlaceholderPlugin { fn build(&self, app: &mut App) { diff --git a/src/render.rs b/src/render.rs index e9b9b64f6134497d64be71ea31abec54def054e1..ba3fd597324b281b88bbea9c09953b5aa63c0bc7 100644 --- a/src/render.rs +++ b/src/render.rs @@ -3,10 +3,11 @@ use bevy::{prelude::*, render::render_resource::Extent3d}; use cosmic_text::{Color, Edit, SwashCache}; use image::{imageops::FilterType, GenericImageView}; +/// System set for cosmic text rendering systems. Runs in [`PostUpdate`] #[derive(SystemSet, Debug, Clone, PartialEq, Eq, Hash)] pub struct RenderSet; -pub struct RenderPlugin; +pub(crate) struct RenderPlugin; impl Plugin for RenderPlugin { fn build(&self, app: &mut App) { @@ -26,7 +27,7 @@ pub(crate) struct SwashCacheState { pub swash_cache: SwashCache, } -pub fn blink_cursor(mut q: Query<&mut CosmicEditor, Without<ReadOnly>>, time: Res<Time>) { +pub(crate) fn blink_cursor(mut q: Query<&mut CosmicEditor, Without<ReadOnly>>, time: Res<Time>) { for mut e in q.iter_mut() { e.cursor_timer.tick(time.delta()); if e.cursor_timer.just_finished() { diff --git a/src/util.rs b/src/util.rs index 6175e52a7b5cdf74b3bce6e5af9454af830bbde6..be8d84c470083e0b75c324ebff9b74f9cecc17d6 100644 --- a/src/util.rs +++ b/src/util.rs @@ -2,12 +2,30 @@ use crate::*; use bevy::{prelude::*, window::PrimaryWindow}; +/// Trait for adding color conversion from [`bevy::prelude::Color`] to [`cosmic_text::Color`] +pub trait ColorExtras { + fn to_cosmic(self) -> CosmicColor; +} + +impl ColorExtras for Color { + fn to_cosmic(self) -> CosmicColor { + CosmicColor::rgba( + (self.r() * 255.) as u8, + (self.g() * 255.) as u8, + (self.b() * 255.) as u8, + (self.a() * 255.) as u8, + ) + } +} + +/// System to unfocus editors when [Esc] is pressed pub fn deselect_editor_on_esc(i: Res<ButtonInput<KeyCode>>, mut focus: ResMut<FocusedWidget>) { if i.just_pressed(KeyCode::Escape) { focus.0 = None; } } +/// Function to find the location of the mouse cursor in a cosmic widget pub fn get_node_cursor_pos( window: &Window, node_transform: &GlobalTransform, @@ -44,6 +62,7 @@ pub fn get_node_cursor_pos( }) } +/// System to allow focus on click for sprite widgets pub fn change_active_editor_sprite( mut commands: Commands, windows: Query<&Window, With<PrimaryWindow>>, @@ -77,6 +96,7 @@ pub fn change_active_editor_sprite( } } +/// System to allow focus on click for UI widgets pub fn change_active_editor_ui( mut commands: Commands, mut interaction_query: Query< @@ -91,6 +111,7 @@ pub fn change_active_editor_ui( } } +/// System to print editor text content on change pub fn print_editor_text( text_inputs_q: Query<&CosmicEditor>, mut previous_value: Local<Vec<String>>, @@ -110,20 +131,13 @@ pub fn print_editor_text( } } -pub fn bevy_color_to_cosmic(color: bevy::prelude::Color) -> CosmicColor { - CosmicColor::rgba( - (color.r() * 255.) as u8, - (color.g() * 255.) as u8, - (color.b() * 255.) as u8, - (color.a() * 255.) as u8, - ) -} - +/// Calls javascript to get the current timestamp #[cfg(target_arch = "wasm32")] pub fn get_timestamp() -> f64 { js_sys::Date::now() } +/// Utility function to get the current unix timestamp #[cfg(not(target_arch = "wasm32"))] pub fn get_timestamp() -> f64 { use std::time::SystemTime; diff --git a/src/widget.rs b/src/widget.rs index 3ef917af31d906c569620f4232d40c25038f5603..8f6ec47a25fbfd942cba32c2397db5ba3bf829d2 100644 --- a/src/widget.rs +++ b/src/widget.rs @@ -2,10 +2,11 @@ use crate::*; use bevy::{prelude::*, window::PrimaryWindow}; use cosmic_text::Affinity; +/// System set for cosmic text layout systems. Runs in [`PostUpdate`] #[derive(SystemSet, Debug, Clone, PartialEq, Eq, Hash)] pub struct WidgetSet; -pub struct WidgetPlugin; +pub(crate) struct WidgetPlugin; impl Plugin for WidgetPlugin { fn build(&self, app: &mut App) { @@ -26,19 +27,28 @@ impl Plugin for WidgetPlugin { } } +/// Wrapper for a [`Vec2`] describing the horizontal and vertical padding of a widget. +/// This is set programatically, not for user modification. +/// To set a widget's padding, use [`CosmicTextAlign`] #[derive(Component, Default, Deref, DerefMut, Debug)] pub struct CosmicPadding(pub Vec2); +/// Wrapper for a [`Vec2`] describing the horizontal and vertical size of a widget. +/// This is set programatically, not for user modification. +/// To set a widget's size, use either it's [`Sprite`] dimensions or modify the target UI element's +/// size. #[derive(Component, Default, Deref, DerefMut)] pub struct CosmicWidgetSize(pub Vec2); -pub fn reshape(mut query: Query<&mut CosmicEditor>, mut font_system: ResMut<CosmicFontSystem>) { +/// Reshapes text in a [`CosmicEditor`] +fn reshape(mut query: Query<&mut CosmicEditor>, mut font_system: ResMut<CosmicFontSystem>) { for mut cosmic_editor in query.iter_mut() { cosmic_editor.shape_as_needed(&mut font_system.0, false); } } -pub fn set_padding( +/// Programatically sets the [`CosmicPadding`] of a widget based on it's [`CosmicTextAlign`] +fn set_padding( mut query: Query< ( &mut CosmicPadding, @@ -81,7 +91,8 @@ pub fn set_padding( } } -pub fn set_widget_size( +/// Programatically sets the [`CosmicWidgetSize`] of a widget based on it's [`Sprite`] properties +fn set_widget_size( mut query: Query<(&mut CosmicWidgetSize, &Sprite), Changed<Sprite>>, windows: Query<&Window, With<PrimaryWindow>>, ) { @@ -95,7 +106,8 @@ pub fn set_widget_size( } } -pub fn set_buffer_size( +/// Sets the internal [`Buffer`]'s size according to the [`CosmicWidgetSize`] and [`CosmicTextAlign`] +fn set_buffer_size( mut query: Query< ( &mut CosmicBuffer, @@ -127,7 +139,8 @@ pub fn set_buffer_size( } } -pub fn new_image_from_default( +/// Instantiates a new image for a [`CosmicBuffer`] +fn new_image_from_default( mut query: Query<&mut Handle<Image>, Added<CosmicBuffer>>, mut images: ResMut<Assets<Image>>, ) { @@ -136,7 +149,7 @@ pub fn new_image_from_default( } } -pub fn set_x_offset( +fn set_x_offset( mut query: Query<( &mut XOffset, &CosmicWrap, @@ -192,7 +205,7 @@ pub fn set_x_offset( } } -pub fn set_sprite_size_from_ui( +fn set_sprite_size_from_ui( mut source_q: Query<&mut Sprite, With<CosmicBuffer>>, dest_q: Query<(&Node, &CosmicSource), Changed<Node>>, ) {