pub struct TmxPlugin { /* private fields */ }
Expand description
Plugin that adds support for .tmx asset loading. Loading behaviour can be customized on creation.
Implementations§
Source§impl TmxPlugin
impl TmxPlugin
Sourcepub fn visit_objects<F: 'static + for<'w> Fn(&Object, &mut EntityMut<'w>) + Send + Sync>(
self,
f: F,
) -> Self
pub fn visit_objects<F: 'static + for<'w> Fn(&Object, &mut EntityMut<'w>) + Send + Sync>( self, f: F, ) -> Self
Adds some custom loading functionality for objects in tmx assets
Sourcepub fn visit_images<F: 'static + for<'w> Fn(&mut EntityMut<'w>) + Send + Sync>(
self,
f: F,
) -> Self
pub fn visit_images<F: 'static + for<'w> Fn(&mut EntityMut<'w>) + Send + Sync>( self, f: F, ) -> Self
Adds some custom loading functionality for image layers in tmx assets
Sourcepub fn visit_map<F: 'static + for<'w> Fn(&Map, &mut World) + Send + Sync>(
self,
f: F,
) -> Self
pub fn visit_map<F: 'static + for<'w> Fn(&Map, &mut World) + Send + Sync>( self, f: F, ) -> Self
Allows to modify the World
loaded from a .tmx asset right before it’s converted to a Scene
.
Sourcepub fn scale(self, scale: Vec2) -> Self
pub fn scale(self, scale: Vec2) -> Self
Sets the scale to apply to the coordinate system of loaded .tmx assets. Defaults to (1, -1), since bevy’s y axis points up where tiled’s y axis points down.
Sourcepub fn depth_scale(self, depth_scale: f32) -> Self
pub fn depth_scale(self, depth_scale: f32) -> Self
Sets the depth added after each layer. Defaults to 1.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TmxPlugin
impl !RefUnwindSafe for TmxPlugin
impl Send for TmxPlugin
impl Sync for TmxPlugin
impl Unpin for TmxPlugin
impl !UnwindSafe for TmxPlugin
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
Mutably borrows from an owned value. Read more
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>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<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>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
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)
Convert
&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)
Convert
&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> DowncastSync for T
impl<T> DowncastSync 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 data from the given WorldSource§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>
Converts
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>
Converts
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