Table of Contents

Class BaseLayer

Namespace
DotTiled
Assembly
DotTiled.dll

Base class for all layer types in a map. To check the type of a layer, use C# pattern matching, or some other mechanism to determine the type of the layer at runtime.

public abstract class BaseLayer : HasPropertiesBase, IHasProperties
Inheritance
BaseLayer
Implements
Derived
Inherited Members

Properties

Class

The class of the layer.

public string Class { get; set; }

Property Value

string

ID

Unique ID of the layer. Each layer that is added to a map gets a unique ID. Even if a layer is deleted, no layer ever gets the same ID.

public required uint ID { get; set; }

Property Value

uint

Name

The name of the layer.

public string Name { get; set; }

Property Value

string

OffsetX

Horizontal offset for this layer in pixels.

public float OffsetX { get; set; }

Property Value

float

OffsetY

Vertical offset for this layer in pixels.

public float OffsetY { get; set; }

Property Value

float

Opacity

The opacity of the layer as a value from 0 (fully transparent) to 1 (fully opaque).

public float Opacity { get; set; }

Property Value

float

ParallaxX

Horizontal parallax factor for this layer.

public float ParallaxX { get; set; }

Property Value

float

ParallaxY

Vertical parallax factor for this layer.

public float ParallaxY { get; set; }

Property Value

float

Properties

Layer properties.

public List<IProperty> Properties { get; set; }

Property Value

List<IProperty>

TintColor

A tint color that is multiplied with any tiles drawn by this layer.

public Optional<Color> TintColor { get; set; }

Property Value

Optional<Color>

Visible

Whether the layer is shown (true) or hidden (false).

public bool Visible { get; set; }

Property Value

bool

Methods

GetProperties()

The properties attached to the object.

public override IList<IProperty> GetProperties()

Returns

IList<IProperty>