From 2e1e050f467a26b405f778fa6c4188362149d288 Mon Sep 17 00:00:00 2001 From: Franklin Date: Sun, 24 Mar 2024 14:50:00 +0100 Subject: [PATCH] Changed default number of scenes and added utility methods to IconCreatorPlugin --- src/plugin.rs | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/plugin.rs b/src/plugin.rs index 9d368dc..2c8fb0e 100644 --- a/src/plugin.rs +++ b/src/plugin.rs @@ -2,7 +2,7 @@ use bevy::{app::{Plugin, Startup, Update}, math::Vec3}; use crate::{created_icons::CreatedIcons, register_types::RegisterTypesPlugin, setup::setup_icon_creation_scenes, state::IconCreatorState, update::{update_give_work_to_scenes, update_icon_creator_scenes, update_replace_images_on_ui_images, update_set_render_layers_recursively}}; -const DEFAULT_SCENES_AMOUNT: u8 = 1; +const DEFAULT_SCENES_AMOUNT: u8 = 2; const DEFAULT_WORLD_POSITION_FOR_ROOT: Vec3 = Vec3 { x: 0.0, y: -300.0, z: 0.0 }; const DEFAULT_RENDER_LAYER: u8 = 21; const DEFAULT_LIGHT_INTENSITY: f32 = 14_000.0; @@ -13,7 +13,7 @@ pub struct IconCreatorPlugin { /// /// A higher value will mean more performance impact but more capacity to render multiple textures at once. /// - /// Default is 1 + /// Default is 2 scenes: u8, /// The global coordinates of the Root of the scenes. /// @@ -58,4 +58,20 @@ impl IconCreatorPlugin { light_intensity, } } + pub fn with_scenes(mut self, scenes: u8) -> Self { + self.scenes = scenes; + self + } + pub fn with_world_pos(mut self, world_pos: Vec3) -> Self { + self.world_pos = world_pos; + self + } + pub fn with_render_layer(mut self, render_layer: u8) -> Self { + self.render_layer = render_layer; + self + } + pub fn with_light_intensity(mut self, light_intensity: f32) -> Self { + self.light_intensity = light_intensity; + self + } } \ No newline at end of file