Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Derive Reflect for all public components #44

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/painter/canvas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pub fn update_canvases(
}

/// Enum that determines when canvases are cleared and redrawn.
#[derive(Default)]
#[derive(Default, Reflect)]
pub enum CanvasMode {
/// Always clear and draw each frame
#[default]
Expand All @@ -61,7 +61,7 @@ pub enum CanvasMode {
/// Component containing data and methods for a given canvas.
///
/// Can be spawned as part of a [`CanvasBundle`] with [`CanvasCommands::spawn_canvas`].
#[derive(Component)]
#[derive(Component, Reflect)]
pub struct Canvas {
/// Handle to the canvas' target texture.
pub image: Handle<Image>,
Expand Down
10 changes: 5 additions & 5 deletions src/shapes/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ mod triangle;
pub use triangle::*;

/// Component that holds data related to a shape to be used during rendering,
#[derive(Component, Clone)]
#[derive(Component, Clone, Reflect)]
pub struct ShapeMaterial {
/// Alpha mode to use when rendering, Blend, Add and Multiply are explicitly supported.
pub alpha_mode: ShapeAlphaMode,
Expand Down Expand Up @@ -64,7 +64,7 @@ impl From<AlphaMode> for ShapeAlphaMode {
}

/// Used in [`ShapeFill`] to determine how a shape is rendered.
#[derive(Default, Clone, Copy)]
#[derive(Default, Clone, Copy, Reflect)]
pub enum FillType {
/// Fully colored shape
#[default]
Expand All @@ -76,7 +76,7 @@ pub enum FillType {
}

/// Component attached to each shape to determine how it is rendered.
#[derive(Default, Component, Clone, Copy)]
#[derive(Default, Component, Clone, Copy, Reflect)]
pub struct ShapeFill {
pub color: Color,
pub ty: FillType,
Expand All @@ -96,13 +96,13 @@ impl ShapeFill {
}

/// Marker component for entities that should be drawn by the 3D pipeline.
#[derive(Component)]
#[derive(Component, Default, Reflect)]
pub struct Shape3d;

/// Overrides the origin of a 3D shape so that transparent drawing order can be overridden.
///
/// This is in local space.
#[derive(Component)]
#[derive(Component, Reflect)]
pub struct ShapeOrigin(pub Vec3);

/// Bundle that is required to render a shape.
Expand Down
Loading