diff --git a/examples/text_box.rs b/examples/text_box.rs index 17286c14715f669adb62c0fb07095f517cb4a85b..3342b6041ab6656135106217a4a2f773b93b82d6 100644 --- a/examples/text_box.rs +++ b/examples/text_box.rs @@ -11,7 +11,7 @@ use kayak_ui::core::{ styles::{Style, StyleProp, Units}, widget, }; -use kayak_ui::widgets::{App, Inspector, OnChange, SpinBox, SpinBoxStyle, TextBox, Window}; +use kayak_ui::widgets::{App, OnChange, SpinBox, SpinBoxStyle, TextBox, Window}; #[widget] fn TextBoxExample() { diff --git a/examples/texture_atlas.rs b/examples/texture_atlas.rs index a5f4de0812de9ae2f81f67c7811c7994eb72de50..4d09377370b1e82f1202d9d62a3e3c82fb43d014 100644 --- a/examples/texture_atlas.rs +++ b/examples/texture_atlas.rs @@ -1,5 +1,6 @@ use bevy::{ prelude::{App as BevyApp, AssetServer, Commands, Handle, Res, ResMut}, + render::texture::ImageSettings, window::WindowDescriptor, DefaultPlugins, }; @@ -8,7 +9,6 @@ use kayak_ui::bevy::{BevyContext, BevyKayakUIPlugin, ImageManager, UICameraBundl use kayak_ui::core::{ render, styles::{Style, StyleProp, Units}, - Index, }; use kayak_ui::widgets::{App, TextureAtlas}; @@ -26,7 +26,12 @@ fn startup( let tile_size = 16; let columns = 272 / tile_size; let rows = 128 / tile_size; - let atlas = bevy::sprite::TextureAtlas::from_grid(image_handle, bevy::prelude::Vec2::splat(tile_size as f32), columns, rows); + let atlas = bevy::sprite::TextureAtlas::from_grid( + image_handle, + bevy::prelude::Vec2::splat(tile_size as f32), + columns, + rows, + ); //The sign in the top right of the image would be index 16 let sign_index = 16; @@ -51,15 +56,15 @@ fn startup( render! { <App> - <TextureAtlas styles={Some(atlas_styles)} - handle={ui_image_handle} - position={(sign_position.x, sign_position.y)} - tile_size={(sign_size.x, sign_size.y)} + <TextureAtlas styles={Some(atlas_styles)} + handle={ui_image_handle} + position={(sign_position.x, sign_position.y)} + tile_size={(sign_size.x, sign_size.y)} /> - <TextureAtlas styles={Some(atlas_styles)} - handle={ui_image_handle} - position={(flower_position.x, flower_position.y)} - tile_size={(flower_size.x, flower_size.y)} + <TextureAtlas styles={Some(atlas_styles)} + handle={ui_image_handle} + position={(flower_position.x, flower_position.y)} + tile_size={(flower_size.x, flower_size.y)} /> </App> } @@ -76,9 +81,9 @@ fn main() { title: String::from("UI Example"), ..Default::default() }) + .insert_resource(ImageSettings::default_nearest()) .add_plugins(DefaultPlugins) .add_plugin(BevyKayakUIPlugin) .add_startup_system(startup) .run(); } - diff --git a/src/widgets/spin_box.rs b/src/widgets/spin_box.rs index 1e8317bb24180d22e96091e7e7425acff624f02c..c60dba53b210212c5b36f76a5b3eb4b3b6318a70 100644 --- a/src/widgets/spin_box.rs +++ b/src/widgets/spin_box.rs @@ -1,4 +1,4 @@ -use std::{fmt::Debug, fmt::Formatter, sync::Arc}; +use std::fmt::Debug; use crate::{ core::{ diff --git a/src/widgets/texture_atlas.rs b/src/widgets/texture_atlas.rs index 07ef35c344dfc70d64ee8108ddb8e252294aa35f..1eade064977f057f5e713d895804f0eefa904866 100644 --- a/src/widgets/texture_atlas.rs +++ b/src/widgets/texture_atlas.rs @@ -31,7 +31,7 @@ pub struct TextureAtlasProps { #[widget] /// A widget that renders a texture atlas /// Allows for the use of a partial square of an image such as in a sprite sheet -/// +/// /// # Props /// /// __Type:__ [`TextureAtlasProps`]