[][src]Struct gdnative::api::TileSet

pub struct TileSet { /* fields omitted */ }

core class TileSet inherits Resource (reference counted).

Official documentation

See the documentation of this class in the Godot engine's official documentation.

Memory management

The lifetime of this object is automatically managed through reference counting.

Class hierarchy

TileSet inherits methods from:

Safety

All types in the Godot API have "interior mutability" in Rust parlance. To enforce that the official thread-safety guidelines are followed, the typestate pattern is used in the Ref and TRef smart pointers, and the Instance API. The typestate Access in these types tracks whether the access is unique, shared, or exclusive to the current thread. For more information, see the type-level documentation on Ref.

Implementations

impl TileSet[src]

Constants

impl TileSet[src]

pub fn new() -> Ref<TileSet, Unique>[src]

Creates a new instance of this object.

This is a reference-counted type. The returned object is automatically managed by Ref.

pub fn autotile_clear_bitmask_map(&self, id: i64)[src]

Clears all bitmask information of the autotile.

pub fn autotile_get_bitmask(
    &self,
    id: i64,
    coord: Vector2D<f32, UnknownUnit>
) -> i64
[src]

Returns the bitmask of the subtile from an autotile given its coordinates.
				The value is the sum of the values in [enum AutotileBindings] present in the subtile (e.g. a value of 5 means the bitmask has bindings in both the top left and top right).

pub fn autotile_get_bitmask_mode(&self, id: i64) -> BitmaskMode[src]

Returns the [enum BitmaskMode] of the autotile.

pub fn autotile_get_icon_coordinate(
    &self,
    id: i64
) -> Vector2D<f32, UnknownUnit>
[src]

Returns the subtile that's being used as an icon in an atlas/autotile given its coordinates.
				The subtile defined as the icon will be used as a fallback when the atlas/autotile's bitmask information is incomplete. It will also be used to represent it in the TileSet editor.

pub fn autotile_get_light_occluder(
    &self,
    id: i64,
    coord: Vector2D<f32, UnknownUnit>
) -> Option<Ref<OccluderPolygon2D, Shared>>
[src]

Returns the light occluder of the subtile from an atlas/autotile given its coordinates.

pub fn autotile_get_navigation_polygon(
    &self,
    id: i64,
    coord: Vector2D<f32, UnknownUnit>
) -> Option<Ref<NavigationPolygon, Shared>>
[src]

Returns the navigation polygon of the subtile from an atlas/autotile given its coordinates.

pub fn autotile_get_size(&self, id: i64) -> Vector2D<f32, UnknownUnit>[src]

Returns the size of the subtiles in an atlas/autotile.

pub fn autotile_get_spacing(&self, id: i64) -> i64[src]

Returns the spacing between subtiles of the atlas/autotile.

pub fn autotile_get_subtile_priority(
    &self,
    id: i64,
    coord: Vector2D<f32, UnknownUnit>
) -> i64
[src]

Returns the priority of the subtile from an autotile given its coordinates.
				When more than one subtile has the same bitmask value, one of them will be picked randomly for drawing. Its priority will define how often it will be picked.

pub fn autotile_get_z_index(
    &self,
    id: i64,
    coord: Vector2D<f32, UnknownUnit>
) -> i64
[src]

Returns the drawing index of the subtile from an atlas/autotile given its coordinates.

pub fn autotile_set_bitmask(
    &self,
    id: i64,
    bitmask: Vector2D<f32, UnknownUnit>,
    flag: i64
)
[src]

Sets the bitmask of the subtile from an autotile given its coordinates.
				The value is the sum of the values in [enum AutotileBindings] present in the subtile (e.g. a value of 5 means the bitmask has bindings in both the top left and top right).

pub fn autotile_set_bitmask_mode(&self, id: i64, mode: i64)[src]

Sets the [enum BitmaskMode] of the autotile.

pub fn autotile_set_icon_coordinate(
    &self,
    id: i64,
    coord: Vector2D<f32, UnknownUnit>
)
[src]

Sets the subtile that will be used as an icon in an atlas/autotile given its coordinates.
				The subtile defined as the icon will be used as a fallback when the atlas/autotile's bitmask information is incomplete. It will also be used to represent it in the TileSet editor.

pub fn autotile_set_light_occluder(
    &self,
    id: i64,
    light_occluder: impl AsArg<OccluderPolygon2D>,
    coord: Vector2D<f32, UnknownUnit>
)
[src]

Sets the light occluder of the subtile from an atlas/autotile given its coordinates.

pub fn autotile_set_navigation_polygon(
    &self,
    id: i64,
    navigation_polygon: impl AsArg<NavigationPolygon>,
    coord: Vector2D<f32, UnknownUnit>
)
[src]

Sets the navigation polygon of the subtile from an atlas/autotile given its coordinates.

pub fn autotile_set_size(&self, id: i64, size: Vector2D<f32, UnknownUnit>)[src]

Sets the size of the subtiles in an atlas/autotile.

pub fn autotile_set_spacing(&self, id: i64, spacing: i64)[src]

Sets the spacing between subtiles of the atlas/autotile.

pub fn autotile_set_subtile_priority(
    &self,
    id: i64,
    coord: Vector2D<f32, UnknownUnit>,
    priority: i64
)
[src]

Sets the priority of the subtile from an autotile given its coordinates.
				When more than one subtile has the same bitmask value, one of them will be picked randomly for drawing. Its priority will define how often it will be picked.

pub fn autotile_set_z_index(
    &self,
    id: i64,
    coord: Vector2D<f32, UnknownUnit>,
    z_index: i64
)
[src]

Sets the drawing index of the subtile from an atlas/autotile given its coordinates.

pub fn clear(&self)[src]

Clears all tiles.

pub fn create_tile(&self, id: i64)[src]

Creates a new tile with the given ID.

pub fn find_tile_by_name(&self, name: impl Into<GodotString>) -> i64[src]

Returns the first tile matching the given name.

pub fn get_last_unused_tile_id(&self) -> i64[src]

Returns the ID following the last currently used ID, useful when creating a new tile.

pub fn get_tiles_ids(&self) -> VariantArray<Shared>[src]

Returns an array of all currently used tile IDs.

pub fn remove_tile(&self, id: i64)[src]

Removes the given tile ID.

pub fn tile_add_shape(
    &self,
    id: i64,
    shape: impl AsArg<Shape2D>,
    shape_transform: Transform2D<f32, UnknownUnit, UnknownUnit>,
    one_way: bool,
    autotile_coord: Vector2D<f32, UnknownUnit>
)
[src]

Adds a shape to the tile.

Default Arguments

  • one_way - false
  • autotile_coord - Vector2( 0, 0 )

pub fn tile_get_light_occluder(
    &self,
    id: i64
) -> Option<Ref<OccluderPolygon2D, Shared>>
[src]

Returns the tile's light occluder.

pub fn tile_get_material(&self, id: i64) -> Option<Ref<ShaderMaterial, Shared>>[src]

Returns the tile's material.

pub fn tile_get_modulate(&self, id: i64) -> Color[src]

Returns the tile's modulation color.

pub fn tile_get_name(&self, id: i64) -> GodotString[src]

Returns the tile's name.

pub fn tile_get_navigation_polygon(
    &self,
    id: i64
) -> Option<Ref<NavigationPolygon, Shared>>
[src]

Returns the navigation polygon of the tile.

pub fn tile_get_navigation_polygon_offset(
    &self,
    id: i64
) -> Vector2D<f32, UnknownUnit>
[src]

Returns the offset of the tile's navigation polygon.

pub fn tile_get_normal_map(&self, id: i64) -> Option<Ref<Texture, Shared>>[src]

Returns the tile's normal map texture.

pub fn tile_get_occluder_offset(&self, id: i64) -> Vector2D<f32, UnknownUnit>[src]

Returns the offset of the tile's light occluder.

pub fn tile_get_region(&self, id: i64) -> Rect<f32, UnknownUnit>[src]

Returns the tile sub-region in the texture.

pub fn tile_get_shape(
    &self,
    id: i64,
    shape_id: i64
) -> Option<Ref<Shape2D, Shared>>
[src]

Returns a tile's given shape.

pub fn tile_get_shape_count(&self, id: i64) -> i64[src]

Returns the number of shapes assigned to a tile.

pub fn tile_get_shape_offset(
    &self,
    id: i64,
    shape_id: i64
) -> Vector2D<f32, UnknownUnit>
[src]

Returns the offset of a tile's shape.

pub fn tile_get_shape_one_way(&self, id: i64, shape_id: i64) -> bool[src]

Returns the one-way collision value of a tile's shape.

pub fn tile_get_shape_one_way_margin(&self, id: i64, shape_id: i64) -> f64[src]

pub fn tile_get_shape_transform(
    &self,
    id: i64,
    shape_id: i64
) -> Transform2D<f32, UnknownUnit, UnknownUnit>
[src]

Returns the [Transform2D] of a tile's shape.

pub fn tile_get_shapes(&self, id: i64) -> VariantArray<Shared>[src]

Returns an array of dictionaries describing the tile's shapes.
				[b]Dictionary structure in the array returned by this method:[/b]
				[codeblock]
				{
				    "autotile_coord": Vector2,
				    "one_way": bool,
				    "one_way_margin": int,
				    "shape": CollisionShape2D,
				    "shape_transform": Transform2D,
				}
				[/codeblock]

pub fn tile_get_texture(&self, id: i64) -> Option<Ref<Texture, Shared>>[src]

Returns the tile's texture.

pub fn tile_get_texture_offset(&self, id: i64) -> Vector2D<f32, UnknownUnit>[src]

Returns the texture offset of the tile.

pub fn tile_get_tile_mode(&self, id: i64) -> TileMode[src]

Returns the tile's [enum TileMode].

pub fn tile_get_z_index(&self, id: i64) -> i64[src]

Returns the tile's Z index (drawing layer).

pub fn tile_set_light_occluder(
    &self,
    id: i64,
    light_occluder: impl AsArg<OccluderPolygon2D>
)
[src]

Sets a light occluder for the tile.

pub fn tile_set_material(&self, id: i64, material: impl AsArg<ShaderMaterial>)[src]

Sets the tile's material.

pub fn tile_set_modulate(&self, id: i64, color: Color)[src]

Sets the tile's modulation color.

pub fn tile_set_name(&self, id: i64, name: impl Into<GodotString>)[src]

Sets the tile's name.

pub fn tile_set_navigation_polygon(
    &self,
    id: i64,
    navigation_polygon: impl AsArg<NavigationPolygon>
)
[src]

Sets the tile's navigation polygon.

pub fn tile_set_navigation_polygon_offset(
    &self,
    id: i64,
    navigation_polygon_offset: Vector2D<f32, UnknownUnit>
)
[src]

Sets an offset for the tile's navigation polygon.

pub fn tile_set_normal_map(&self, id: i64, normal_map: impl AsArg<Texture>)[src]

Sets the tile's normal map texture.
				[b]Note:[/b] Godot expects the normal map to use X+, Y-, and Z+ coordinates. See [url=http://wiki.polycount.com/wiki/Normal_Map_Technical_Details#Common_Swizzle_Coordinates]this page[/url] for a comparison of normal map coordinates expected by popular engines.

pub fn tile_set_occluder_offset(
    &self,
    id: i64,
    occluder_offset: Vector2D<f32, UnknownUnit>
)
[src]

Sets an offset for the tile's light occluder.

pub fn tile_set_region(&self, id: i64, region: Rect<f32, UnknownUnit>)[src]

Sets the tile's sub-region in the texture. This is common in texture atlases.

pub fn tile_set_shape(&self, id: i64, shape_id: i64, shape: impl AsArg<Shape2D>)[src]

Sets a shape for the tile, enabling collision.

pub fn tile_set_shape_offset(
    &self,
    id: i64,
    shape_id: i64,
    shape_offset: Vector2D<f32, UnknownUnit>
)
[src]

Sets the offset of a tile's shape.

pub fn tile_set_shape_one_way(&self, id: i64, shape_id: i64, one_way: bool)[src]

Enables one-way collision on a tile's shape.

pub fn tile_set_shape_one_way_margin(
    &self,
    id: i64,
    shape_id: i64,
    one_way: f64
)
[src]

pub fn tile_set_shape_transform(
    &self,
    id: i64,
    shape_id: i64,
    shape_transform: Transform2D<f32, UnknownUnit, UnknownUnit>
)
[src]

Sets a [Transform2D] on a tile's shape.

pub fn tile_set_shapes(&self, id: i64, shapes: VariantArray<Shared>)[src]

Sets an array of shapes for the tile, enabling collision.

pub fn tile_set_texture(&self, id: i64, texture: impl AsArg<Texture>)[src]

Sets the tile's texture.

pub fn tile_set_texture_offset(
    &self,
    id: i64,
    texture_offset: Vector2D<f32, UnknownUnit>
)
[src]

Sets the tile's texture offset.

pub fn tile_set_tile_mode(&self, id: i64, tilemode: i64)[src]

Sets the tile's [enum TileMode].

pub fn tile_set_z_index(&self, id: i64, z_index: i64)[src]

Sets the tile's drawing index.

Methods from Deref<Target = Resource>

pub fn duplicate(&self, subresources: bool) -> Option<Ref<Resource, Shared>>[src]

Duplicates the resource, returning a new resource. By default, sub-resources are shared between resource copies for efficiency. This can be changed by passing [code]true[/code] to the [code]subresources[/code] argument which will copy the subresources.
				[b]Note:[/b] If [code]subresources[/code] is [code]true[/code], this method will only perform a shallow copy. Nested resources within subresources will not be duplicated and will still be shared.

Default Arguments

  • subresources - false

pub fn get_local_scene(&self) -> Option<Ref<Node, Shared>>[src]

If [member resource_local_to_scene] is enabled and the resource was loaded from a [PackedScene] instantiation, returns the local scene where this resource's unique copy is in use. Otherwise, returns [code]null[/code].

pub fn name(&self) -> GodotString[src]

The name of the resource. This is an optional identifier.

pub fn path(&self) -> GodotString[src]

The path to the resource. In case it has its own file, it will return its filepath. If it's tied to the scene, it will return the scene's path, followed by the resource's index.

pub fn get_rid(&self) -> Rid[src]

Returns the RID of the resource (or an empty RID). Many resources (such as [Texture], [Mesh], etc) are high-level abstractions of resources stored in a server, so this function will return the original RID.

pub fn is_local_to_scene(&self) -> bool[src]

If [code]true[/code], the resource will be made unique in each instance of its local scene. It can thus be modified in a scene instance without impacting other instances of that same scene.

pub fn set_local_to_scene(&self, enable: bool)[src]

If [code]true[/code], the resource will be made unique in each instance of its local scene. It can thus be modified in a scene instance without impacting other instances of that same scene.

pub fn set_name(&self, name: impl Into<GodotString>)[src]

The name of the resource. This is an optional identifier.

pub fn set_path(&self, path: impl Into<GodotString>)[src]

The path to the resource. In case it has its own file, it will return its filepath. If it's tied to the scene, it will return the scene's path, followed by the resource's index.

pub fn setup_local_to_scene(&self)[src]

This method is called when a resource with [member resource_local_to_scene] enabled is loaded from a [PackedScene] instantiation. Its behavior can be customized by overriding [method _setup_local_to_scene] from script.
				For most resources, this method performs no base logic. [ViewportTexture] performs custom logic to properly set the proxy texture and flags in the local viewport.

pub fn take_over_path(&self, path: impl Into<GodotString>)[src]

Sets the path of the resource, potentially overriding an existing cache entry for this path. This differs from setting [member resource_path], as the latter would error out if another resource was already cached for the given path.

Trait Implementations

impl Debug for TileSet[src]

impl Deref for TileSet[src]

type Target = Resource

The resulting type after dereferencing.

impl DerefMut for TileSet[src]

impl GodotObject for TileSet[src]

type RefKind = RefCounted

The memory management kind of this type. This modifies the behavior of the Ref smart pointer. See its type-level documentation for more information. Read more

impl Instanciable for TileSet[src]

impl SubClass<Object> for TileSet[src]

impl SubClass<Reference> for TileSet[src]

impl SubClass<Resource> for TileSet[src]

Auto Trait Implementations

impl RefUnwindSafe for TileSet

impl !Send for TileSet

impl !Sync for TileSet

impl Unpin for TileSet

impl UnwindSafe for TileSet

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SubClass<T> for T where
    T: GodotObject
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.