pub struct FileDialogPlugin(/* private fields */);
Expand description
Add this plugin to Bevy App to use the FileDialog
resource in your system
to save/load files.
Implementations§
Source§impl FileDialogPlugin
impl FileDialogPlugin
Sourcepub fn with_pick_directory<T: PickDirectoryPath>(self) -> Self
pub fn with_pick_directory<T: PickDirectoryPath>(self) -> Self
Allow picking directory paths. This allows you to call
FileDialog::pick_directory_path
and
FileDialog::pick_multiple_directory_paths
on Commands
. For each
with_pick_directory
you will receive DialogDirectoryPicked<T>
in your
systems when picking completes.
Does not exist in WASM32
.
Sourcepub fn with_pick_file<T: PickFilePath>(self) -> Self
pub fn with_pick_file<T: PickFilePath>(self) -> Self
Allow picking file paths. This allows you to call
FileDialog::pick_file_path
and
FileDialog::pick_multiple_file_paths
on Commands
. For each
with_pick_file
you will receive DialogFilePicked<T>
in your
systems when picking completes.
Does not exist in WASM32
. If you want cross-platform solution for
files, you need to use FileDialogPlugin::with_load_file
, which
allows picking and loading in one step which is compatible with wasm.
Source§impl FileDialogPlugin
impl FileDialogPlugin
Sourcepub fn new() -> Self
pub fn new() -> Self
Create new file dialog plugin. Do not forget to call at least one
with_save_file
, with_load_file
or with_pick_directory
on the plugin to allow you to
save/load files and pick directories.
Sourcepub fn with_save_file<T: SaveContents>(self) -> Self
pub fn with_save_file<T: SaveContents>(self) -> Self
Allow saving file contents. This allows you to call
dialog().save_file::<T>()
on Commands
. For each with_save_file
you
will receive DialogFileSaved<T>
in your systems when save_file
completes.
Sourcepub fn with_load_file<T: LoadContents>(self) -> Self
pub fn with_load_file<T: LoadContents>(self) -> Self
Allow loading file contents. This allows you to call
dialog().load_file::<T>()
on Commands
. For each with_load_file
you
will receive DialogFileLoaded<T>
in your systems when load_file
completes.
Trait Implementations§
Source§impl Default for FileDialogPlugin
impl Default for FileDialogPlugin
Source§fn default() -> FileDialogPlugin
fn default() -> FileDialogPlugin
Source§impl Plugin for FileDialogPlugin
impl Plugin for FileDialogPlugin
Source§fn ready(&self, _app: &App) -> bool
fn ready(&self, _app: &App) -> bool
finish
should be called.Source§fn finish(&self, _app: &mut App)
fn finish(&self, _app: &mut App)
App
, once all plugins registered are ready. This can
be useful for plugins that depends on another plugin asynchronous setup, like the renderer.Source§fn cleanup(&self, _app: &mut App)
fn cleanup(&self, _app: &mut App)
Auto Trait Implementations§
impl Freeze for FileDialogPlugin
impl !RefUnwindSafe for FileDialogPlugin
impl Send for FileDialogPlugin
impl Sync for FileDialogPlugin
impl Unpin for FileDialogPlugin
impl !UnwindSafe for FileDialogPlugin
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
, which can then be
downcast
into Box<dyn ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
, which can then be further
downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
Source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self
using default()
.
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more