pub struct TileMap {
pub tiles: InheritableVariable<Option<TileMapDataResource>>,
pub before_effects: Vec<TileMapEffectRef>,
pub after_effects: Vec<TileMapEffectRef>,
/* private fields */
}
Expand description
Tile map is a 2D “image”, made out of a small blocks called tiles. Tile maps used in 2D games to
build game worlds quickly and easily. Each tile is represented by a TileDefinitionHandle
which
contains the position of a page and the position of a tile within that page.
When rendering the TileMap
, the rendering data is fetched from the tile map’s tile set resource,
which contains all the pages that may be referenced by the tile map’s handles.
Optional TileMapEffect
objects may be included in the TileMap
to change how it renders.
Fields§
§tiles: InheritableVariable<Option<TileMapDataResource>>
Tile container of the tile map.
before_effects: Vec<TileMapEffectRef>
Special rendering effects that may change how the tile map renders. These effects are processed in order before the tile map performs the normal rendering of tiles, and they can prevent some times from being rendered and render other tiles in place of what would normally be rendered.
after_effects: Vec<TileMapEffectRef>
Special rendering effects that may change how the tile map renders. These effects are processed in order after the tile map performs the normal rendering of tiles.
Implementations§
Source§impl TileMap
impl TileMap
Sourcepub fn tile_handle(
&self,
position: Vector2<i32>,
) -> Option<TileDefinitionHandle>
pub fn tile_handle( &self, position: Vector2<i32>, ) -> Option<TileDefinitionHandle>
The handle that is stored in the tile map at the given position to refer to some tile in the tile set.
Sourcepub fn tile_data(&self, position: Vector2<i32>) -> Option<TileMapDataRef<'_>>
pub fn tile_data(&self, position: Vector2<i32>) -> Option<TileMapDataRef<'_>>
The tile data for the tile at the given position, if that position has a tile and this tile map has a tile set that contains data for the tile’s handle.
Sourcepub fn tile_property_value<T>(
&self,
position: Vector2<i32>,
property_id: Uuid,
) -> Result<T, TilePropertyError>
pub fn tile_property_value<T>( &self, position: Vector2<i32>, property_id: Uuid, ) -> Result<T, TilePropertyError>
The property value for the property of the given name for the tile at the given position in this tile map. This requires that the tile map has a loaded tile set and the tile set contains a property with the given name. Otherwise an error is returned to indicate which of these conditions failed. If the only problem is that there is no tile at the given position, then the default value for the property’s value type is returned.
Sourcepub fn tile_property_value_by_name(
&self,
position: Vector2<i32>,
property_name: &ImmutableString,
) -> Result<TileSetPropertyValue, TilePropertyError>
pub fn tile_property_value_by_name( &self, position: Vector2<i32>, property_name: &ImmutableString, ) -> Result<TileSetPropertyValue, TilePropertyError>
The property value for the property of the given name for the tile at the given position in this tile map. This requires that the tile map has a loaded tile set and the tile set contains a property with the given name. Otherwise an error is returned to indicate which of these conditions failed. If the only problem is that there is no tile at the given position, then the default value for the property’s value type is returned.
Sourcepub fn tile_property_value_by_uuid_untyped(
&self,
position: Vector2<i32>,
property_id: Uuid,
) -> Result<TileSetPropertyValue, TilePropertyError>
pub fn tile_property_value_by_uuid_untyped( &self, position: Vector2<i32>, property_id: Uuid, ) -> Result<TileSetPropertyValue, TilePropertyError>
The property value for the property of the given UUID for the tile at the given position in this tile map. This requires that the tile map has a loaded tile set and the tile set contains a property with the given UUID. Otherwise an error is returned to indicate which of these conditions failed. If the only problem is that there is no tile at the given position, then the default value for the property’s value type is returned.
Sourcepub fn tile_map_transform(&self) -> Matrix4<f32>
pub fn tile_map_transform(&self) -> Matrix4<f32>
The global transform of the tile map with initial x-axis flip applied, so the positive x-axis points left instead of right.
Sourcepub fn tile_set(&self) -> Option<&TileSetResource>
pub fn tile_set(&self) -> Option<&TileSetResource>
Returns a reference to the current tile set (if any).
Sourcepub fn set_tile_set(&mut self, tile_set: Option<TileSetResource>)
pub fn set_tile_set(&mut self, tile_set: Option<TileSetResource>)
Sets new tile set.
Sourcepub fn tiles(&self) -> Option<&TileMapDataResource>
pub fn tiles(&self) -> Option<&TileMapDataResource>
Returns a reference to the tile container.
Sourcepub fn set_tiles(&mut self, tiles: TileMapDataResource)
pub fn set_tiles(&mut self, tiles: TileMapDataResource)
Sets new tiles.
Sourcepub fn tile_scale(&self) -> Vector2<f32>
pub fn tile_scale(&self) -> Vector2<f32>
Returns current tile scaling.
Sourcepub fn set_tile_scale(&mut self, tile_scale: Vector2<f32>)
pub fn set_tile_scale(&mut self, tile_scale: Vector2<f32>)
Sets new tile scaling, which defines tile size.
Sourcepub fn insert_tile(
&mut self,
position: Vector2<i32>,
tile: TileDefinitionHandle,
) -> Option<TileDefinitionHandle>
pub fn insert_tile( &mut self, position: Vector2<i32>, tile: TileDefinitionHandle, ) -> Option<TileDefinitionHandle>
Inserts a tile in the tile map. Returns previous tile, located at the same position as the new one (if any).
Sourcepub fn remove_tile(
&mut self,
position: Vector2<i32>,
) -> Option<TileDefinitionHandle>
pub fn remove_tile( &mut self, position: Vector2<i32>, ) -> Option<TileDefinitionHandle>
Removes a tile from the tile map.
Sourcepub fn active_brush(&self) -> Option<&TileMapBrushResource>
pub fn active_brush(&self) -> Option<&TileMapBrushResource>
Returns active brush of the tile map.
Sourcepub fn set_active_brush(&mut self, brush: Option<TileMapBrushResource>)
pub fn set_active_brush(&mut self, brush: Option<TileMapBrushResource>)
Sets new active brush of the tile map.
Sourcepub fn bounding_rect(&self) -> OptionTileRect
pub fn bounding_rect(&self) -> OptionTileRect
Calculates bounding rectangle in grid coordinates.
Methods from Deref<Target = Base>§
pub const NAME: &'static str = "name"
pub const LOCAL_TRANSFORM: &'static str = "local_transform"
pub const VISIBILITY: &'static str = "visibility"
pub const ENABLED: &'static str = "enabled"
pub const LIFETIME: &'static str = "lifetime"
pub const LOD_GROUP: &'static str = "lod_group"
pub const MOBILITY: &'static str = "mobility"
pub const TAG: &'static str = "tag"
pub const CAST_SHADOWS: &'static str = "cast_shadows"
pub const PROPERTIES: &'static str = "properties"
pub const FRUSTUM_CULLING: &'static str = "frustum_culling"
pub const IS_RESOURCE_INSTANCE_ROOT: &'static str = "is_resource_instance_root"
pub const RESOURCE: &'static str = "resource"
pub const SCRIPTS: &'static str = "scripts"
Sourcepub fn handle(&self) -> Handle<Node>
pub fn handle(&self) -> Handle<Node>
Returns handle of the node. A node has valid handle only after it was inserted in a graph!
Sourcepub fn set_name<N: AsRef<str>>(&mut self, name: N)
pub fn set_name<N: AsRef<str>>(&mut self, name: N)
Sets name of node. Can be useful to mark a node to be able to find it later on.
Sourcepub fn name_owned(&self) -> String
pub fn name_owned(&self) -> String
Returns owned name of node.
Sourcepub fn local_transform(&self) -> &Transform
pub fn local_transform(&self) -> &Transform
Returns shared reference to local transform of a node, can be used to fetch some local spatial properties, such as position, rotation, scale, etc.
Sourcepub fn local_transform_mut(&mut self) -> &mut Transform
pub fn local_transform_mut(&mut self) -> &mut Transform
Returns mutable reference to local transform of a node, can be used to set some local spatial properties, such as position, rotation, scale, etc.
Sourcepub fn set_local_transform(&mut self, transform: Transform)
pub fn set_local_transform(&mut self, transform: Transform)
Sets new local transform of a node.
Sourcepub fn find_properties_ref<'a>(
&'a self,
name: &'a str,
) -> impl Iterator<Item = &'a Property>
pub fn find_properties_ref<'a>( &'a self, name: &'a str, ) -> impl Iterator<Item = &'a Property>
Tries to find properties by the name. The method returns an iterator because it possible to have multiple properties with the same name.
Sourcepub fn find_first_property_ref(&self, name: &str) -> Option<&Property>
pub fn find_first_property_ref(&self, name: &str) -> Option<&Property>
Tries to find a first property with the given name.
Sourcepub fn set_properties(&mut self, properties: Vec<Property>) -> Vec<Property>
pub fn set_properties(&mut self, properties: Vec<Property>) -> Vec<Property>
Sets a new set of properties of the node.
Sourcepub fn set_lifetime(&mut self, time_seconds: Option<f32>) -> &mut Self
pub fn set_lifetime(&mut self, time_seconds: Option<f32>) -> &mut Self
Sets lifetime of node in seconds, lifetime is useful for temporary objects. Example - you firing a gun, it produces two particle systems for each shot: one for gunpowder fumes and one when bullet hits some surface. These particle systems won’t last very long - usually they will disappear in 1-2 seconds but nodes will still be in scene consuming precious CPU clocks. This is where lifetimes become handy - you just set appropriate lifetime for a particle system node and it will be removed from scene when time will end. This is efficient algorithm because scene holds every object in pool and allocation or deallocation of node takes very little amount of time.
Sourcepub fn lifetime(&self) -> Option<f32>
pub fn lifetime(&self) -> Option<f32>
Returns current lifetime of a node. Will be None if node has undefined lifetime.
For more info about lifetimes see set_lifetime
.
Sourcepub fn children(&self) -> &[Handle<Node>]
pub fn children(&self) -> &[Handle<Node>]
Returns slice of handles to children nodes. This can be used, for example, to traverse tree starting from some node.
Sourcepub fn global_transform(&self) -> Matrix4<f32>
pub fn global_transform(&self) -> Matrix4<f32>
Returns global transform matrix, such matrix contains combined transformation of transforms of parent nodes. This is the final matrix that describes real location of object in the world.
Sourcepub fn global_transform_without_scaling(&self) -> Matrix4<f32>
pub fn global_transform_without_scaling(&self) -> Matrix4<f32>
Calculates global transform of the node, but discards scaling part of it.
Sourcepub fn inv_bind_pose_transform(&self) -> Matrix4<f32>
pub fn inv_bind_pose_transform(&self) -> Matrix4<f32>
Returns inverse of bind pose matrix. Bind pose matrix - is special matrix for bone nodes, it stores initial transform of bone node at the moment of “binding” vertices to bones.
Sourcepub fn is_resource_instance_root(&self) -> bool
pub fn is_resource_instance_root(&self) -> bool
Returns true if this node is model resource instance root node.
Sourcepub fn resource(&self) -> Option<ModelResource>
pub fn resource(&self) -> Option<ModelResource>
Returns resource from which this node was instantiated from.
Sourcepub fn set_visibility(&mut self, visibility: bool) -> bool
pub fn set_visibility(&mut self, visibility: bool) -> bool
Sets local visibility of a node.
Sourcepub fn visibility(&self) -> bool
pub fn visibility(&self) -> bool
Returns local visibility of a node.
Sourcepub fn local_bounding_box(&self) -> AxisAlignedBoundingBox
pub fn local_bounding_box(&self) -> AxisAlignedBoundingBox
Returns current local-space bounding box. Keep in mind that this value is just a placeholder, because there is not information to calculate actual bounding box.
Sourcepub fn world_bounding_box(&self) -> AxisAlignedBoundingBox
pub fn world_bounding_box(&self) -> AxisAlignedBoundingBox
Returns current world-space bounding box.
Sourcepub fn set_mobility(&mut self, mobility: Mobility) -> Mobility
pub fn set_mobility(&mut self, mobility: Mobility) -> Mobility
Set new mobility for the node. See Mobility
docs for more info.
Sourcepub fn global_visibility(&self) -> bool
pub fn global_visibility(&self) -> bool
Returns combined visibility of an node. This is the final visibility of a node. Global visibility calculated using visibility of all parent nodes until root one, so if some parent node upper on tree is invisible then all its children will be invisible. It defines if object will be rendered. It is not the same as real visibility from point of view of a camera. Use frustum-box intersection test instead.
Sourcepub fn original_handle_in_resource(&self) -> Handle<Node>
pub fn original_handle_in_resource(&self) -> Handle<Node>
Handle to node in scene of model resource from which this node was instantiated from.
§Notes
This handle is extensively used to fetch information about the state of node in the resource to sync properties of instance with its original in the resource.
Sourcepub fn global_position(&self) -> Vector3<f32>
pub fn global_position(&self) -> Vector3<f32>
Returns position of the node in absolute coordinates.
Sourcepub fn look_vector(&self) -> Vector3<f32>
pub fn look_vector(&self) -> Vector3<f32>
Returns “look” vector of global transform basis, in most cases return vector will be non-normalized.
Sourcepub fn side_vector(&self) -> Vector3<f32>
pub fn side_vector(&self) -> Vector3<f32>
Returns “side” vector of global transform basis, in most cases return vector will be non-normalized.
Sourcepub fn up_vector(&self) -> Vector3<f32>
pub fn up_vector(&self) -> Vector3<f32>
Returns “up” vector of global transform basis, in most cases return vector will be non-normalized.
Sourcepub fn set_lod_group(&mut self, lod_group: Option<LodGroup>) -> Option<LodGroup>
pub fn set_lod_group(&mut self, lod_group: Option<LodGroup>) -> Option<LodGroup>
Sets new lod group.
Sourcepub fn take_lod_group(&mut self) -> Option<LodGroup>
pub fn take_lod_group(&mut self) -> Option<LodGroup>
Extracts lod group, leaving None in the node.
Sourcepub fn lod_group_mut(&mut self) -> Option<&mut LodGroup>
pub fn lod_group_mut(&mut self) -> Option<&mut LodGroup>
Returns mutable reference to current lod group.
Sourcepub fn frustum_culling(&self) -> bool
pub fn frustum_culling(&self) -> bool
Return the frustum_culling flag
Sourcepub fn set_frustum_culling(&mut self, frustum_culling: bool) -> bool
pub fn set_frustum_culling(&mut self, frustum_culling: bool) -> bool
Sets whether to use frustum culling or not
Sourcepub fn cast_shadows(&self) -> bool
pub fn cast_shadows(&self) -> bool
Returns true if the node should cast shadows, false - otherwise.
Sourcepub fn set_cast_shadows(&mut self, cast_shadows: bool) -> bool
pub fn set_cast_shadows(&mut self, cast_shadows: bool) -> bool
Sets whether the mesh should cast shadows or not.
Sourcepub fn instance_id(&self) -> SceneNodeId
pub fn instance_id(&self) -> SceneNodeId
Returns current instance id.
Sourcepub fn remove_script(&mut self, index: usize)
pub fn remove_script(&mut self, index: usize)
Removes a script with the given index
from the scene node. The script will be destroyed
in either the current update tick (if it was removed from some other script) or in the next
update tick of the parent graph.
Sourcepub fn remove_all_scripts(&mut self)
pub fn remove_all_scripts(&mut self)
Removes all assigned scripts from the scene node. The scripts will be removed from first-to-last order an their actual destruction will happen either on the current update tick of the parent graph (if it was removed from some other script) or in the next update tick.
Sourcepub fn replace_script(&mut self, index: usize, script: Option<Script>)
pub fn replace_script(&mut self, index: usize, script: Option<Script>)
Sets a new script for the scene node by index. Previous script will be removed (see
Self::remove_script
docs for more info).
Sourcepub fn add_script<T>(&mut self, script: T)where
T: ScriptTrait,
pub fn add_script<T>(&mut self, script: T)where
T: ScriptTrait,
Adds a new script to the scene node. The new script will be initialized either in the current
update tick (if the script was added in one of the ScriptTrait
methods) or on the next
update tick.
Sourcepub fn has_script<T>(&self) -> boolwhere
T: ScriptTrait,
pub fn has_script<T>(&self) -> boolwhere
T: ScriptTrait,
Checks if the node has a script of a particular type. Returns false
if there is no such
script.
Sourcepub fn has_scripts_assigned(&self) -> bool
pub fn has_scripts_assigned(&self) -> bool
Checks if the node has any scripts assigned.
Sourcepub fn try_get_script<T>(&self) -> Option<&T>where
T: ScriptTrait,
pub fn try_get_script<T>(&self) -> Option<&T>where
T: ScriptTrait,
Tries to find a first script of the given type T
, returns None
if there’s no such
script.
Sourcepub fn try_get_scripts<T>(&self) -> impl Iterator<Item = &T>where
T: ScriptTrait,
pub fn try_get_scripts<T>(&self) -> impl Iterator<Item = &T>where
T: ScriptTrait,
Returns an iterator that yields references to the scripts of the given type T
.
Sourcepub fn try_get_script_mut<T>(&mut self) -> Option<&mut T>where
T: ScriptTrait,
pub fn try_get_script_mut<T>(&mut self) -> Option<&mut T>where
T: ScriptTrait,
Tries to find a first script of the given type T
, returns None
if there’s no such
script.
Sourcepub fn try_get_scripts_mut<T>(&mut self) -> impl Iterator<Item = &mut T>where
T: ScriptTrait,
pub fn try_get_scripts_mut<T>(&mut self) -> impl Iterator<Item = &mut T>where
T: ScriptTrait,
Returns an iterator that yields references to the scripts of the given type T
.
Sourcepub fn try_get_script_component<C>(&self) -> Option<&C>where
C: Any,
pub fn try_get_script_component<C>(&self) -> Option<&C>where
C: Any,
Tries find a component of the given type C
across all available scripts of the node.
If you want to search a component C
in a particular script, then use Self::try_get_script
and then search for component in it.
Sourcepub fn try_get_script_component_mut<C>(&mut self) -> Option<&mut C>where
C: Any,
pub fn try_get_script_component_mut<C>(&mut self) -> Option<&mut C>where
C: Any,
Tries find a component of the given type C
across all available scripts of the node.
If you want to search a component C
in a particular script, then use Self::try_get_script
and then search for component in it.
Sourcepub fn script_count(&self) -> usize
pub fn script_count(&self) -> usize
Returns total count of scripts assigned to the node.
Sourcepub fn script(&self, index: usize) -> Option<&Script>
pub fn script(&self, index: usize) -> Option<&Script>
Returns a shared reference to a script instance with the given index
. This method will
return None
if the index
is out of bounds or the script is temporarily not available.
This could happen if this method was called from some method of a ScriptTrait
. It
happens because of borrowing rules - you cannot take another reference to a script that is
already mutably borrowed.
Sourcepub fn scripts(&self) -> impl Iterator<Item = &Script>
pub fn scripts(&self) -> impl Iterator<Item = &Script>
Returns an iterator that yields all assigned scripts.
Sourcepub fn script_mut(&mut self, index: usize) -> Option<&mut Script>
pub fn script_mut(&mut self, index: usize) -> Option<&mut Script>
Returns a mutable reference to a script instance with the given index
. This method will
return None
if the index
is out of bounds or the script is temporarily not available.
This could happen if this method was called from some method of a ScriptTrait
. It
happens because of borrowing rules - you cannot take another reference to a script that is
already mutably borrowed.
§Important notes
Do not replace script instance using mutable reference given to you by this method.
This will prevent correct script de-initialization! Use Self::replace_script
if you need
to replace the script.
Sourcepub fn scripts_mut(&mut self) -> impl Iterator<Item = &mut Script>
pub fn scripts_mut(&mut self) -> impl Iterator<Item = &mut Script>
Returns an iterator that yields all assigned scripts.
Sourcepub fn set_enabled(&mut self, enabled: bool) -> bool
pub fn set_enabled(&mut self, enabled: bool) -> bool
Enables or disables scene node. Disabled scene nodes won’t be updated (including scripts) or rendered.
§Important notes
Enabled/disabled state will affect children nodes. It means that if you have a node with children nodes,
and you disable the node, all children nodes will be disabled too even if their Self::is_enabled
method
returns true
.
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Returns true
if the node is enabled, false
- otherwise. The return value does not include the state
of parent nodes. It should be considered as “local” enabled flag. To get actual enabled state, that includes
the state of parent nodes, use Self::is_globally_enabled
method.
Sourcepub fn is_globally_enabled(&self) -> bool
pub fn is_globally_enabled(&self) -> bool
Returns true
if the node and every parent up in hierarchy is enabled, false
- otherwise. This method
returns “true” enabled
flag. Its value could be different from the value returned by Self::is_enabled
.
Sourcepub fn root_resource(&self) -> Option<ModelResource>
pub fn root_resource(&self) -> Option<ModelResource>
Returns a root resource of the scene node. This method crawls up on dependency tree until it finds that the ancestor node does not have any dependencies and returns this resource as the root resource. For example, in case of simple scene node instance, this method will return the resource from which the node was instantiated from. In case of 2 or more levels of dependency, it will always return the “top” dependency in the dependency graph.
Trait Implementations§
Source§impl ComponentProvider for TileMap
impl ComponentProvider for TileMap
Source§impl ConstructorProvider<Node, Graph> for TileMap
impl ConstructorProvider<Node, Graph> for TileMap
fn constructor() -> NodeConstructor
Source§impl NodeTrait for TileMap
impl NodeTrait for TileMap
Source§fn local_bounding_box(&self) -> AxisAlignedBoundingBox
fn local_bounding_box(&self) -> AxisAlignedBoundingBox
Source§fn world_bounding_box(&self) -> AxisAlignedBoundingBox
fn world_bounding_box(&self) -> AxisAlignedBoundingBox
Source§fn id(&self) -> Uuid
fn id(&self) -> Uuid
Source§fn collect_render_data(&self, ctx: &mut RenderContext<'_>) -> RdcControlFlow
fn collect_render_data(&self, ctx: &mut RenderContext<'_>) -> RdcControlFlow
Source§fn validate(&self, _scene: &Scene) -> Result<(), String>
fn validate(&self, _scene: &Scene) -> Result<(), String>
Source§fn on_removed_from_graph(&mut self, graph: &mut Graph)
fn on_removed_from_graph(&mut self, graph: &mut Graph)
Source§fn on_unlink(&mut self, graph: &mut Graph)
fn on_unlink(&mut self, graph: &mut Graph)
Source§fn sync_native(
&self,
self_handle: Handle<Node>,
context: &mut SyncContext<'_, '_>,
)
fn sync_native( &self, self_handle: Handle<Node>, context: &mut SyncContext<'_, '_>, )
crate::scene::rigidbody::RigidBody
node.Source§fn on_global_transform_changed(
&self,
new_global_transform: &Matrix4<f32>,
context: &mut SyncContext<'_, '_>,
)
fn on_global_transform_changed( &self, new_global_transform: &Matrix4<f32>, context: &mut SyncContext<'_, '_>, )
Source§fn on_local_transform_changed(&self, context: &mut SyncContext<'_, '_>)
fn on_local_transform_changed(&self, context: &mut SyncContext<'_, '_>)
Source§fn is_alive(&self) -> bool
fn is_alive(&self) -> bool
Source§fn update(&mut self, context: &mut UpdateContext<'_>)
fn update(&mut self, context: &mut UpdateContext<'_>)
Source§fn should_be_rendered(&self, frustum: Option<&Frustum>) -> bool
fn should_be_rendered(&self, frustum: Option<&Frustum>) -> bool
Source§fn debug_draw(&self, ctx: &mut SceneDrawingContext)
fn debug_draw(&self, ctx: &mut SceneDrawingContext)
Source§impl Reflect for TileMapwhere
Self: 'static,
Base: Reflect,
InheritableVariable<Option<TileSetResource>>: Reflect,
InheritableVariable<Vector2<f32>>: Reflect,
InheritableVariable<Option<TileMapBrushResource>>: Reflect,
impl Reflect for TileMapwhere
Self: 'static,
Base: Reflect,
InheritableVariable<Option<TileSetResource>>: Reflect,
InheritableVariable<Vector2<f32>>: Reflect,
InheritableVariable<Option<TileMapBrushResource>>: Reflect,
fn source_path() -> &'static str
fn type_name(&self) -> &'static str
fn doc(&self) -> &'static str
Source§fn assembly_name(&self) -> &'static str
fn assembly_name(&self) -> &'static str
#[derive(Reflect)]
) to ensure that this method will return correct assembly
name. In other words - there’s no guarantee, that any implementation other than proc-macro
will return a correct name of the assembly. Alternatively, you can use env!("CARGO_PKG_NAME")
as an implementation.Source§fn type_assembly_name() -> &'static str
fn type_assembly_name() -> &'static str
#[derive(Reflect)]
) to ensure that this method will return correct assembly
name. In other words - there’s no guarantee, that any implementation other than proc-macro
will return a correct name of the assembly. Alternatively, you can use env!("CARGO_PKG_NAME")
as an implementation.fn fields_info(&self, func: &mut dyn FnMut(&[FieldInfo<'_, '_>]))
fn into_any(self: Box<Self>) -> Box<dyn Any>
fn set( &mut self, value: Box<dyn Reflect>, ) -> Result<Box<dyn Reflect>, Box<dyn Reflect>>
fn as_any(&self, func: &mut dyn FnMut(&dyn Any))
fn as_any_mut(&mut self, func: &mut dyn FnMut(&mut dyn Any))
fn as_reflect(&self, func: &mut dyn FnMut(&dyn Reflect))
fn as_reflect_mut(&mut self, func: &mut dyn FnMut(&mut dyn Reflect))
fn fields(&self, func: &mut dyn FnMut(&[&dyn Reflect]))
fn fields_mut(&mut self, func: &mut dyn FnMut(&mut [&mut dyn Reflect]))
fn field(&self, name: &str, func: &mut dyn FnMut(Option<&dyn Reflect>))
fn field_mut( &mut self, name: &str, func: &mut dyn FnMut(Option<&mut dyn Reflect>), )
Source§fn set_field(
&mut self,
field: &str,
value: Box<dyn Reflect>,
func: &mut dyn FnMut(Result<Box<dyn Reflect>, Box<dyn Reflect>>),
)
fn set_field( &mut self, field: &str, value: Box<dyn Reflect>, func: &mut dyn FnMut(Result<Box<dyn Reflect>, Box<dyn Reflect>>), )
#[reflect(setter = ..)]
or falls back to
Reflect::field_mut
fn as_array(&self, func: &mut dyn FnMut(Option<&(dyn ReflectArray + 'static)>))
fn as_array_mut( &mut self, func: &mut dyn FnMut(Option<&mut (dyn ReflectArray + 'static)>), )
fn as_list(&self, func: &mut dyn FnMut(Option<&(dyn ReflectList + 'static)>))
fn as_list_mut( &mut self, func: &mut dyn FnMut(Option<&mut (dyn ReflectList + 'static)>), )
fn as_inheritable_variable( &self, func: &mut dyn FnMut(Option<&(dyn ReflectInheritableVariable + 'static)>), )
fn as_inheritable_variable_mut( &mut self, func: &mut dyn FnMut(Option<&mut (dyn ReflectInheritableVariable + 'static)>), )
fn as_hash_map( &self, func: &mut dyn FnMut(Option<&(dyn ReflectHashMap + 'static)>), )
fn as_hash_map_mut( &mut self, func: &mut dyn FnMut(Option<&mut (dyn ReflectHashMap + 'static)>), )
Auto Trait Implementations§
impl !Freeze for TileMap
impl !RefUnwindSafe for TileMap
impl Send for TileMap
impl !Sync for TileMap
impl Unpin for TileMap
impl !UnwindSafe for TileMap
Blanket Implementations§
Source§impl<T> AsyncTaskResult for T
impl<T> AsyncTaskResult for T
Source§impl<T> BaseNodeTrait for T
impl<T> BaseNodeTrait for T
Source§fn clone_box(&self) -> Node
fn clone_box(&self) -> Node
Source§fn as_any_ref(&self) -> &(dyn Any + 'static)
fn as_any_ref(&self) -> &(dyn Any + 'static)
Any
Source§fn as_any_ref_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_ref_mut(&mut self) -> &mut (dyn Any + 'static)
Any
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
. 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>
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)
&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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Any
. Could be used to downcast a trait object
to a particular type.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Any
. Could be used to downcast a trait object
to a particular type.fn into_any(self: Box<T>) -> Box<dyn Any>
Source§impl<T> FieldValue for Twhere
T: 'static,
impl<T> FieldValue for Twhere
T: 'static,
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian()
.Source§impl<T> ReflectBase for Twhere
T: Reflect,
impl<T> ReflectBase for Twhere
T: Reflect,
fn as_any_raw(&self) -> &(dyn Any + 'static)
fn as_any_raw_mut(&mut self) -> &mut (dyn Any + 'static)
Source§impl<T> ResolvePath for Twhere
T: Reflect,
impl<T> ResolvePath for Twhere
T: Reflect,
fn resolve_path<'p>( &self, path: &'p str, func: &mut dyn FnMut(Result<&(dyn Reflect + 'static), ReflectPathError<'p>>), )
fn resolve_path_mut<'p>( &mut self, path: &'p str, func: &mut dyn FnMut(Result<&mut (dyn Reflect + 'static), ReflectPathError<'p>>), )
fn get_resolve_path<'p, T>(
&self,
path: &'p str,
func: &mut dyn FnMut(Result<&T, ReflectPathError<'p>>),
)where
T: Reflect,
fn get_resolve_path_mut<'p, T>(
&mut self,
path: &'p str,
func: &mut dyn FnMut(Result<&mut T, ReflectPathError<'p>>),
)where
T: Reflect,
Source§impl<T> ScriptMessagePayload for T
impl<T> ScriptMessagePayload for T
Source§fn as_any_ref(&self) -> &(dyn Any + 'static)
fn as_any_ref(&self) -> &(dyn Any + 'static)
self
as &dyn Any
Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
self
as &dyn Any
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.