Struct gdnative_bindings_lily::TileSet[][src]

pub struct TileSet { /* fields omitted */ }
Expand description

core class TileSet inherits Resource (reference counted).

Official documentation

See the documentation of this class in the Godot engine’s official documentation. The method descriptions are generated from it and typically contain code samples in GDScript, not Rust.

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

Constants

Creates a new instance of this object.

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

Clears all bitmask information of the autotile.

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).

Returns the [enum BitmaskMode] of the autotile.

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.

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

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

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

Returns the spacing between subtiles of the atlas/autotile.

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.

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

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).

Sets the [enum BitmaskMode] of the autotile.

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.

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

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

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

Sets the spacing between subtiles of the atlas/autotile.

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.

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

Clears all tiles.

Creates a new tile with the given ID.

Returns the first tile matching the given name.

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

Returns an array of all currently used tile IDs.

Removes the given tile ID.

Adds a shape to the tile.

Default Arguments

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

Returns the tile’s light occluder.

Returns the tile’s material.

Returns the tile’s modulation color.

Returns the tile’s name.

Returns the navigation polygon of the tile.

Returns the offset of the tile’s navigation polygon.

Returns the tile’s normal map texture.

Returns the offset of the tile’s light occluder.

Returns the tile sub-region in the texture.

Returns a tile’s given shape.

Returns the number of shapes assigned to a tile.

Returns the offset of a tile’s shape.

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

Returns the Transform2D of a tile’s shape.

Sample code is GDScript unless otherwise noted.

Returns an array of dictionaries describing the tile’s shapes. Dictionary structure in the array returned by this method:

{
    "autotile_coord": Vector2,
    "one_way": bool,
    "one_way_margin": int,
    "shape": CollisionShape2D,
    "shape_transform": Transform2D,
}

Returns the tile’s texture.

Returns the texture offset of the tile.

Returns the tile’s [enum TileMode].

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

Sets a light occluder for the tile.

Sets the tile’s material.

Sets the tile’s modulation color.

Sets the tile’s name.

Sets the tile’s navigation polygon.

Sets an offset for the tile’s navigation polygon.

Sets the tile’s normal map texture. Note: 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.

Sets an offset for the tile’s light occluder.

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

Sets a shape for the tile, enabling collision.

Sets the offset of a tile’s shape.

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

Sets a Transform2D on a tile’s shape.

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

Sets the tile’s texture.

Sets the tile’s texture offset.

Sets the tile’s [enum TileMode].

Sets the tile’s drawing index.

Methods from Deref<Target = Resource>

Duplicates the resource, returning a new resource. By default, sub-resources are shared between resource copies for efficiency. This can be changed by passing true to the subresources argument which will copy the subresources. Note: If subresources is true, 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

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 null.

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

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.

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.

If true, 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.

If true, 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.

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

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.

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.

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

Formats the value using the given formatter. Read more

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

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

Creates an explicitly null reference of Self as a method argument. This makes type inference easier for the compiler compared to Option. Read more

Creates a new instance of Self using a zero-argument constructor, as a Unique reference. Read more

Performs a dynamic reference downcast to target type. Read more

Performs a static reference upcast to a supertype that is guaranteed to be valid. Read more

Creates a persistent reference to the same Godot object with shared thread access. Read more

Creates a persistent reference to the same Godot object with thread-local thread access. Read more

Creates a persistent reference to the same Godot object with unique access. Read more

Recovers a instance ID previously returned by Object::get_instance_id if the object is still alive. See also TRef::try_from_instance_id. Read more

Recovers a instance ID previously returned by Object::get_instance_id if the object is still alive, and panics otherwise. This does NOT guarantee that the resulting reference is safe to use. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.