|
Method
public TMXLayerLoadState LoadLayer(string sourceLayerName, int destinationLayer, SpriteSheetAsset spriteSheet = null)
|
public TMXLayerLoadState LoadLayer(string sourceLayerName, int destinationLayer, Rect2i sourceRect, Vector2i destPos)
|
public TMXLayerLoadState LoadLayer(string sourceLayerName, int destinationLayer, PackedSpriteID [] packedSpriteLookup)
|
public TMXLayerLoadState LoadLayer(string sourceLayerName, int destinationLayer, Rect2i sourceRect, Vector2i destPos, PackedSpriteID [] packedSpriteLookup)
|
public TMXLayerLoadState LoadLayer(string sourceLayerName, int destinationLayer, PackedSprite [] packedSpriteLookup)
|
public TMXLayerLoadState LoadLayer(string sourceLayerName, int destinationLayer, Rect2i sourceRect, Vector2i destPos, PackedSprite [] packedSpriteLookup)
|
public TMXLayerLoadState LoadLayer(string sourceLayerName, int destinationLayer, FastString [] packedSpriteLookup)
|
public TMXLayerLoadState LoadLayer(string sourceLayerName, int destinationLayer, Rect2i sourceRect, Vector2i destPos, FastString [] packedSpriteLookup)
|
public TMXLayerLoadState LoadLayer(string sourceLayerName, int destinationLayer, string [] packedSpriteLookup)
|
public TMXLayerLoadState LoadLayer(string sourceLayerName, int destinationLayer, Rect2i sourceRect, Vector2i destPos, string [] packedSpriteLookup)
|
Parameters
sourceLayerName
|
string
|
Name of the TMX layer. Duplicate layer names are not supported
|
destinationLayer
|
int
|
The RetroBlit layer to load into
|
spriteSheet
|
SpriteSheetAsset
|
Sprite sheet to use for this layer
|
sourceRect
|
Rect2i
|
Source rectangular tilemap area to load from
|
destPos
|
Vector2i
|
Destination position in the RetroBlit layer in tile coordinates
|
packedSpriteLookup
|
PackedSpriteID []
|
Lookup table for translating TMX tile indexes to packed sprites
|
Returns
TMXLayerLoadState
Layer loading state
DescriptionLoad a TMX map layer from a standard map. For infinite maps use TMXMapAsset.LoadLayerChunk instead. There are various asset sources supported: - Resources - Synchronously loaded TMX Map assets from a Resources folder. This was the only asset source supported in RetroBlit prior to 3.0.
- ResourcesAsync - Asynchronously loaded TMX Map assets from a Resources folder.
- WWW - Asynchronously loaded TMX Map assets from a URL.
- AddressableAssets - Asynchronously loaded TMX Map assets from Unity Addressable Assets.
The layer into which the layer tile data is loaded if specified by destinationLayer. Optionally a sub-section of a layer can be loaded by specifying sourceRect. The destination position of the tile data can also be specified with destPos. The sprite sheet or sprite pack can be specified for this layer by passing spriteSheet parameter, or later by RB.MapLayerSpriteSheetSet. If a sprite pack is specified then a lookup array can be passed using packedSpriteLookup, which will help RetroBlit translate from tilemap sprite indices to packed sprites. Besides tile sprite information TMXMapAsset.LoadLayer also loads TMXProperties for each tile. These properties can be set inside of Tiled. This can be very useful for defining gameplay affecting properties such as whether a particular tile is "blocking". ExampleSee AlsoTMXMapAsset.Load TMXMapAsset.LoadLayerChunk RB.Result RB.AssetStatus RB.AssetSourceSee DocsFeatures - Tilemaps Features - Tiled TMX Support Features - Asynchronous Asset Loading |