-
Notifications
You must be signed in to change notification settings - Fork 0
TileData
Home | API by Category | Complete API Index | API Compatibility
| Field | Value |
|---|---|
| Full name | Electron2D.TileData |
| Namespace | Electron2D |
| Kind | class |
| Category | Rendering |
Stores per-tile metadata consumed by Electron2D.TileMapLayer.
public sealed class Electron2D.TileData : Electron2D.ObjectProfile: Electron2D 0.1.0 2D
Status: Partial / Not verified
Out of profile: yes
Godot reference: TileData
Tile metadata resource with modulation, texture origin, z-index and per-layer collision polygon settings.
TileData contains the rendering modulation and collision polygon metadata
for a tile entry inside a Electron2D.TileSetAtlasSource.
This type is not synchronized. Create and mutate tile data on the main scene thread or during loading.
This type is available since Electron2D 0.1.0 Preview.
Electron2D.TileMapLayerElectron2D.TileSetAtlasSource
| Member | Kind | Summary |
|---|---|---|
Modulate |
Property | Gets or sets the color multiplied into the tile draw command. |
TextureOrigin |
Property | Gets or sets the visual offset applied to this tile inside its cell. |
ZIndex |
Property | Gets or sets the z-index offset for this tile. |
Electron2D.TileData() |
Constructor | Initializes a new instance of the Electron2D.TileData type. |
GetCollisionPolygonOneWayMargin(System.Int32, System.Int32) |
Method | Gets the one-way collision margin for a polygon. |
GetCollisionPolygonPoints(System.Int32, System.Int32) |
Method | Gets the points for a collision polygon. |
GetCollisionPolygonsCount(System.Int32) |
Method | Gets the number of collision polygons in a collision layer. |
IsCollisionPolygonOneWay(System.Int32, System.Int32) |
Method | Checks whether a collision polygon is one-way. |
SetCollisionPolygonOneWay(System.Int32, System.Int32, System.Boolean) |
Method | Sets whether a collision polygon is one-way. |
SetCollisionPolygonOneWayMargin(System.Int32, System.Int32, System.Single) |
Method | Sets the one-way collision margin for a polygon. |
SetCollisionPolygonPoints(System.Int32, System.Int32, Electron2D.Vector2[]) |
Method | Sets the points for a collision polygon. |
SetCollisionPolygonsCount(System.Int32, System.Int32) |
Method | Sets the number of collision polygons stored in a collision layer. |
Kind: Property
public Electron2D.Color Modulate { get; set; }Gets or sets the color multiplied into the tile draw command.
The value is combined with the owning layer's inherited canvas modulation during rendering.
The color multiplied into this tile; the default value is
Electron2D.Color.White.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.TileMapLayer
Kind: Property
public Electron2D.Vector2 TextureOrigin { get; set; }Gets or sets the visual offset applied to this tile inside its cell.
TileMapLayer adds this value to the destination rectangle position
when it submits the tile for rendering.
The local offset in pixels from the cell's top-left corner.
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: Property
public System.Int32 ZIndex { get; set; }Gets or sets the z-index offset for this tile.
This preview uses the value when ordering submitted tile commands inside the canvas render queue.
The z-index offset added to the owning TileMapLayer.ZIndex.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.CanvasItem.ZIndex
Kind: Constructor
public Electron2D.TileData()Initializes a new instance of the Electron2D.TileData type.
New tile data starts with white modulation, zero texture origin, zero z-index and no collision polygons.
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.TileSetAtlasSource.CreateTile(Electron2D.Vector2I,Electron2D.Vector2I)
Kind: Method
public System.Single GetCollisionPolygonOneWayMargin(System.Int32, System.Int32)(System.Int32 layerId, System.Int32 polygonIndex)Gets the one-way collision margin for a polygon.
New collision polygons use a margin of 1.
-
layerId: The collision layer metadata id. -
polygonIndex: The polygon index inside the layer.
The stored one-way collision margin.
-
System.ArgumentOutOfRangeException: Thrown when the layer or polygon index is invalid.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.TileData.SetCollisionPolygonOneWayMargin(System.Int32,System.Int32,System.Single)
Kind: Method
public Electron2D.Vector2[] GetCollisionPolygonPoints(System.Int32, System.Int32)(System.Int32 layerId, System.Int32 polygonIndex)Gets the points for a collision polygon.
The returned array can be modified by the caller without mutating this
tile data. Use Electron2D.TileData.SetCollisionPolygonPoints(System.Int32,System.Int32,Electron2D.Vector2[]) to store changes.
-
layerId: The collision layer metadata id. -
polygonIndex: The polygon index inside the layer.
A new array containing the polygon points.
-
System.ArgumentOutOfRangeException: Thrown when the layer or polygon index is invalid.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.TileData.SetCollisionPolygonPoints(System.Int32,System.Int32,Electron2D.Vector2[])
Kind: Method
public System.Int32 GetCollisionPolygonsCount(System.Int32)(System.Int32 layerId)Gets the number of collision polygons in a collision layer.
Missing layers report 0.
-
layerId: The collision layer metadata id.
The number of polygons stored in the layer.
-
System.ArgumentOutOfRangeException: Thrown whenlayerIdis negative.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.TileData.SetCollisionPolygonsCount(System.Int32,System.Int32)
Kind: Method
public System.Boolean IsCollisionPolygonOneWay(System.Int32, System.Int32)(System.Int32 layerId, System.Int32 polygonIndex)Checks whether a collision polygon is one-way.
Missing or invalid polygons are not treated as one-way polygons.
-
layerId: The collision layer metadata id. -
polygonIndex: The polygon index inside the layer.
true when the polygon is one-way; otherwise, false.
-
System.ArgumentOutOfRangeException: Thrown when the layer or polygon index is invalid.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.TileData.SetCollisionPolygonOneWay(System.Int32,System.Int32,System.Boolean)
Kind: Method
public System.Void SetCollisionPolygonOneWay(System.Int32, System.Int32, System.Boolean)(System.Int32 layerId, System.Int32 polygonIndex, System.Boolean oneWay)Sets whether a collision polygon is one-way.
The managed movement baseline uses this flag for downward movement against tile polygons.
-
layerId: The collision layer metadata id. -
polygonIndex: The polygon index inside the layer. -
oneWay: Whether the polygon should block only from one side.
-
System.ArgumentOutOfRangeException: Thrown when the layer or polygon index is invalid.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.TileData.IsCollisionPolygonOneWay(System.Int32,System.Int32)
Kind: Method
public System.Void SetCollisionPolygonOneWayMargin(System.Int32, System.Int32, System.Single)(System.Int32 layerId, System.Int32 polygonIndex, System.Single margin)Sets the one-way collision margin for a polygon.
Higher values make one-way collision more tolerant for fast downward movement.
-
layerId: The collision layer metadata id. -
polygonIndex: The polygon index inside the layer. -
margin: The non-negative margin in local units.
-
System.ArgumentOutOfRangeException: Thrown when the layer, polygon index or margin is invalid.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.TileData.GetCollisionPolygonOneWayMargin(System.Int32,System.Int32)
Kind: Method
public System.Void SetCollisionPolygonPoints(System.Int32, System.Int32, Electron2D.Vector2[])(System.Int32 layerId, System.Int32 polygonIndex, Electron2D.Vector2[] polygon)Sets the points for a collision polygon.
The runtime physics baseline uses the AABB of these points for direct queries and body movement.
-
layerId: The collision layer metadata id. -
polygonIndex: The polygon index inside the layer. -
polygon: The polygon points in cell-local coordinates.
-
System.ArgumentNullException: Thrown whenpolygonisnull. -
System.ArgumentOutOfRangeException: Thrown when the layer or polygon index is invalid.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.TileData.GetCollisionPolygonPoints(System.Int32,System.Int32)
Kind: Method
public System.Void SetCollisionPolygonsCount(System.Int32, System.Int32)(System.Int32 layerId, System.Int32 polygonsCount)Sets the number of collision polygons stored in a collision layer.
Increasing the count creates empty polygons. Decreasing the count removes polygons at the end of the layer.
-
layerId: The collision layer metadata id. -
polygonsCount: The number of polygons to keep in the layer.
-
System.ArgumentOutOfRangeException: Thrown whenlayerIdorpolygonsCountis negative.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.TileData.GetCollisionPolygonsCount(System.Int32)
Electron2D 0.1.0 Preview API reference. Generated from 175 public runtime types.