-
Notifications
You must be signed in to change notification settings - Fork 0
TileSet
Home | API by Category | Complete API Index | API Compatibility
| Field | Value |
|---|---|
| Full name | Electron2D.TileSet |
| Namespace | Electron2D |
| Kind | class |
| Category | Rendering |
Stores tile sources and shared tilemap settings.
public sealed class Electron2D.TileSet : Electron2D.ResourceProfile: Electron2D 0.1.0 2D
Status: Partial / Not verified
Out of profile: yes
Godot reference: TileSet
Tile set resource with tile size, source id mapping, source lookup and deterministic source listing.
TileSet is a resource assigned to Electron2D.TileMapLayer. The 0.1.0
Preview supports atlas sources and a single rectangular cell size.
This type is not synchronized. Create and mutate tile sets on the main scene thread or during loading.
This type is available since Electron2D 0.1.0 Preview.
Electron2D.TileMapLayerElectron2D.TileSetAtlasSource
| Member | Kind | Summary |
|---|---|---|
TileSize |
Property | Gets or sets the size of a tilemap cell. |
Electron2D.TileSet() |
Constructor | Initializes a new instance of the Electron2D.TileSet type. |
AddSource(Electron2D.TileSetSource, System.Int32) |
Method | Adds a source to this tile set. |
Clear() |
Method | Removes all sources from this tile set. |
GetSource(System.Int32) |
Method | Gets a source by id. |
GetSourceCount() |
Method | Gets the number of sources stored by this tile set. |
GetSourceId(System.Int32) |
Method | Gets a source id by index. |
HasSource(System.Int32) |
Method | Checks whether a source id exists. |
RemoveSource(System.Int32) |
Method | Removes a source from this tile set. |
Kind: Property
public Electron2D.Vector2I TileSize { get; set; }Gets or sets the size of a tilemap cell.
Rendering destination rectangles and tile collision placement use this size.
The positive width and height used by Electron2D.TileMapLayer cells.
-
System.ArgumentOutOfRangeException: Thrown when either component is less than or equal to zero.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.TileMapLayer.MapToLocal(Electron2D.Vector2I)
Kind: Constructor
public Electron2D.TileSet()Initializes a new instance of the Electron2D.TileSet type.
The tile set starts empty and uses a 16x16 cell size.
This constructor is not synchronized. Call it from the thread that owns the resource being created.
This constructor is available since Electron2D 0.1.0 Preview.
Electron2D.TileSet.AddSource(Electron2D.TileSetSource,System.Int32)
Kind: Method
public System.Int32 AddSource(Electron2D.TileSetSource, System.Int32)(Electron2D.TileSetSource source, System.Int32 atlasSourceIdOverride)Adds a source to this tile set.
Automatically allocated ids use the lowest non-negative id that is not currently assigned.
-
source: The source resource to add. -
atlasSourceIdOverride: The requested source id, or-1to allocate one.
The source id assigned to source.
-
System.ArgumentNullException: Thrown whensourceisnull. -
System.ArgumentOutOfRangeException: Thrown whenatlasSourceIdOverrideis less than-1. -
System.InvalidOperationException: Thrown when the requested source id is already used.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.TileSet.GetSource(System.Int32)
Kind: Method
public System.Void Clear()()Removes all sources from this tile set.
This method keeps Electron2D.TileSet.TileSize unchanged.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.TileSet.RemoveSource(System.Int32)
Kind: Method
public Electron2D.TileSetSource GetSource(System.Int32)(System.Int32 sourceId)Gets a source by id.
The returned source is the same resource instance that was passed to
Electron2D.TileSet.AddSource(Electron2D.TileSetSource,System.Int32).
-
sourceId: The source id to query.
The source resource, or null when no source has that id.
-
System.ArgumentOutOfRangeException: Thrown whensourceIdis negative.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.TileSet.AddSource(Electron2D.TileSetSource,System.Int32)
Kind: Method
public System.Int32 GetSourceCount()()Gets the number of sources stored by this tile set.
The count includes sources of every implemented source type.
The number of assigned sources.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.TileSet.GetSourceId(System.Int32)
Kind: Method
public System.Int32 GetSourceId(System.Int32)(System.Int32 index)Gets a source id by index.
Source ids are returned in ascending numeric order.
-
index: The zero-based index in sorted source id order.
The source id at the requested index.
-
System.ArgumentOutOfRangeException: Thrown whenindexis outside the stored source range.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.TileSet.GetSourceCount
Kind: Method
public System.Boolean HasSource(System.Int32)(System.Int32 sourceId)Checks whether a source id exists.
This method does not validate the source resource contents.
-
sourceId: The source id to query.
true when the source exists; otherwise, false.
-
System.ArgumentOutOfRangeException: Thrown whensourceIdis negative.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.TileSet.GetSource(System.Int32)
Kind: Method
public System.Void RemoveSource(System.Int32)(System.Int32 sourceId)Removes a source from this tile set.
Removing a missing source does nothing. Existing tilemap cells that point to the source remain stored but will not render or collide.
-
sourceId: The source id to remove.
-
System.ArgumentOutOfRangeException: Thrown whensourceIdis negative.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.TileSet.HasSource(System.Int32)
Electron2D 0.1.0 Preview API reference. Generated from 175 public runtime types.