UI component bundles derive clone (#390)
make Draw, TextStyle, and the rest of the ui components derive clone
This commit is contained in:
parent
17e7642611
commit
00be5d083e
@ -50,7 +50,7 @@ pub enum RenderCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// A component that indicates how to draw an entity.
|
/// A component that indicates how to draw an entity.
|
||||||
#[derive(Properties)]
|
#[derive(Properties, Clone)]
|
||||||
pub struct Draw {
|
pub struct Draw {
|
||||||
pub is_visible: bool,
|
pub is_visible: bool,
|
||||||
pub is_transparent: bool,
|
pub is_transparent: bool,
|
||||||
|
@ -34,7 +34,7 @@ impl RenderPipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Properties)]
|
#[derive(Properties, Clone)]
|
||||||
pub struct RenderPipelines {
|
pub struct RenderPipelines {
|
||||||
pub pipelines: Vec<RenderPipeline>,
|
pub pipelines: Vec<RenderPipeline>,
|
||||||
#[property(ignore)]
|
#[property(ignore)]
|
||||||
|
@ -15,6 +15,7 @@ use bevy_render::{
|
|||||||
};
|
};
|
||||||
use bevy_sprite::{TextureAtlas, TextureAtlasSprite};
|
use bevy_sprite::{TextureAtlas, TextureAtlasSprite};
|
||||||
|
|
||||||
|
#[derive(Clone)]
|
||||||
pub struct TextStyle {
|
pub struct TextStyle {
|
||||||
pub font_size: f32,
|
pub font_size: f32,
|
||||||
pub color: Color,
|
pub color: Color,
|
||||||
|
@ -18,7 +18,7 @@ use bevy_transform::{
|
|||||||
prelude::{Rotation, Scale, Transform, Translation},
|
prelude::{Rotation, Scale, Transform, Translation},
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Bundle)]
|
#[derive(Bundle, Clone)]
|
||||||
pub struct NodeComponents {
|
pub struct NodeComponents {
|
||||||
pub node: Node,
|
pub node: Node,
|
||||||
pub style: Style,
|
pub style: Style,
|
||||||
@ -62,7 +62,7 @@ impl Default for NodeComponents {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Bundle)]
|
#[derive(Bundle, Clone)]
|
||||||
pub struct ImageComponents {
|
pub struct ImageComponents {
|
||||||
pub node: Node,
|
pub node: Node,
|
||||||
pub style: Style,
|
pub style: Style,
|
||||||
@ -110,7 +110,7 @@ impl Default for ImageComponents {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Bundle)]
|
#[derive(Bundle, Clone)]
|
||||||
pub struct TextComponents {
|
pub struct TextComponents {
|
||||||
pub node: Node,
|
pub node: Node,
|
||||||
pub style: Style,
|
pub style: Style,
|
||||||
@ -140,7 +140,7 @@ impl Default for TextComponents {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Bundle)]
|
#[derive(Bundle, Clone)]
|
||||||
pub struct ButtonComponents {
|
pub struct ButtonComponents {
|
||||||
pub node: Node,
|
pub node: Node,
|
||||||
pub button: Button,
|
pub button: Button,
|
||||||
|
@ -1 +1,2 @@
|
|||||||
|
#[derive(Clone)]
|
||||||
pub struct Button;
|
pub struct Button;
|
||||||
|
@ -5,6 +5,7 @@ use bevy_math::Size;
|
|||||||
use bevy_render::texture::Texture;
|
use bevy_render::texture::Texture;
|
||||||
use bevy_sprite::ColorMaterial;
|
use bevy_sprite::ColorMaterial;
|
||||||
|
|
||||||
|
#[derive(Clone)]
|
||||||
pub enum Image {
|
pub enum Image {
|
||||||
KeepAspect,
|
KeepAspect,
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ use bevy_sprite::TextureAtlas;
|
|||||||
use bevy_text::{DrawableText, Font, FontAtlasSet, TextStyle};
|
use bevy_text::{DrawableText, Font, FontAtlasSet, TextStyle};
|
||||||
use bevy_transform::prelude::Transform;
|
use bevy_transform::prelude::Transform;
|
||||||
|
|
||||||
#[derive(Default)]
|
#[derive(Default, Clone)]
|
||||||
pub struct Text {
|
pub struct Text {
|
||||||
pub value: String,
|
pub value: String,
|
||||||
pub font: Handle<Font>,
|
pub font: Handle<Font>,
|
||||||
|
Loading…
Reference in New Issue
Block a user