pub struct WasmTile { /* private fields */ }
Implementations§
Source§impl WasmTile
impl WasmTile
Sourcepub fn new(effect: &WasmEffect, area: &WasmRect) -> WasmTile
pub fn new(effect: &WasmEffect, area: &WasmRect) -> WasmTile
Create a new tile from an effect and area
Sourcepub fn effect(&self) -> WasmEffect
pub fn effect(&self) -> WasmEffect
Get the effect of this tile
Sourcepub fn set_effect(&mut self, effect: &WasmEffect)
pub fn set_effect(&mut self, effect: &WasmEffect)
Set the effect of this tile
Sourcepub fn apply(&mut self, effect: &WasmEffect)
pub fn apply(&mut self, effect: &WasmEffect)
Apply a new effect to this tile (overwrites existing)
Sourcepub fn is_blocking_at(&self, target: &WasmCoordinates) -> bool
pub fn is_blocking_at(&self, target: &WasmCoordinates) -> bool
Returns true if tile blocks movement or interaction at the given coordinate
Sourcepub fn offset(&mut self, delta: &WasmDelta)
pub fn offset(&mut self, delta: &WasmDelta)
Offsets the tile’s area and effect’s blocking region by the given delta
Sourcepub fn translate(&mut self, delta: &WasmDelta)
pub fn translate(&mut self, delta: &WasmDelta)
Translate the tile by a delta (alias for offset)
Sourcepub fn contains(&self, coord: &WasmCoordinates) -> bool
pub fn contains(&self, coord: &WasmCoordinates) -> bool
Returns true if the tile’s area contains the specified coordinate
Trait Implementations§
Source§impl FromWasmAbi for WasmTile
impl FromWasmAbi for WasmTile
Source§impl IntoWasmAbi for WasmTile
impl IntoWasmAbi for WasmTile
Source§impl LongRefFromWasmAbi for WasmTile
impl LongRefFromWasmAbi for WasmTile
Source§impl OptionFromWasmAbi for WasmTile
impl OptionFromWasmAbi for WasmTile
Source§impl OptionIntoWasmAbi for WasmTile
impl OptionIntoWasmAbi for WasmTile
Source§impl RefFromWasmAbi for WasmTile
impl RefFromWasmAbi for WasmTile
Source§impl RefMutFromWasmAbi for WasmTile
impl RefMutFromWasmAbi for WasmTile
Source§impl TryFromJsValue for WasmTile
impl TryFromJsValue for WasmTile
Source§impl VectorFromWasmAbi for WasmTile
impl VectorFromWasmAbi for WasmTile
Source§impl VectorIntoWasmAbi for WasmTile
impl VectorIntoWasmAbi for WasmTile
impl Eq for WasmTile
impl StructuralPartialEq for WasmTile
impl SupportsConstructor for WasmTile
impl SupportsInstanceProperty for WasmTile
impl SupportsStaticProperty for WasmTile
Auto Trait Implementations§
impl Freeze for WasmTile
impl RefUnwindSafe for WasmTile
impl Send for WasmTile
impl Sync for WasmTile
impl Unpin for WasmTile
impl UnwindSafe for WasmTile
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::Abi
Source§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi
, except that it may throw and never
return in the case of Err
.