Struct MapQuery

Source
pub struct MapQuery {}

Implementations§

Source§

impl MapQuery

Source

pub fn for_each_layer_of(level: &LdtkLevel, cb: impl FnMut(&LdtkLayer))

Perform an action on each layer of the given LDTK level

Source

pub fn get_layers_of( level: &LdtkLevel, ) -> impl DoubleEndedIterator<Item = &LdtkLayer>

Retrieve an iterator over every layer in the given level, regardless of type

Source

pub fn get_entities_of(level: &LdtkLevel) -> Vec<&EntityInstance>

Retrieve a reference to every entity stored in the given level, regardless of which layer it is found on

Source

pub fn get_instance_refs_of(level: &LdtkLevel) -> Vec<InstanceRef<'_>>

Retrieve an enhanced wrapper to every entity stored in the given level, regardless of which layer it is found on

Source

pub fn get_filtered_entities_of( level: &LdtkLevel, entity_type: impl ToString, ) -> Vec<&EntityInstance>

Retrieve a reference to every entity stored in the given level that matches the specified type name. This must exactly match the name shown in the LDTK entity list

Source

pub fn get_filtered_instance_refs_of( level: &LdtkLevel, entity_type: impl ToString, ) -> Vec<InstanceRef<'_>>

Retrieve an enhanced wrapper to every entity stored in the given level that matches the specified type name. This must exactly match the name shown in the LDTK entity list

Source

pub fn get_owned_entities_of(level: &LdtkLevel) -> Vec<EntityInstance>

Retrieve an owned copy of all entity data in the given level

Source

pub fn get_camera_bounds_of(level: &LdtkLevel) -> CameraBounds

Use the size of the level to create a zero-based rectangle indicating the boundaries that a camera should stay within to avoid showing any out-of-level space

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.