Table of Contents

Class TileLayer

Namespace
PAC.Image.Layers

A class to represent a tile layer - one for placing and editing tileset tiles.

public class TileLayer : Layer
Inheritance
TileLayer
Inherited Members
Extension Methods

Constructors

TileLayer(TileLayer)

Creates a deep copy of the TileLayer.

public TileLayer(TileLayer layer)

Parameters

layer TileLayer

TileLayer(string, int, int)

public TileLayer(string name, int width, int height)

Parameters

name string
width int
height int

Properties

layerType

public override LayerType layerType { get; }

Property Value

LayerType

tiles

The tiles on this layer.

public List<Tile> tiles { get; }

Property Value

List<Tile>

Methods

AddTile(Tile)

Adds the tile to the layer.

public void AddTile(Tile tile)

Parameters

tile Tile

ClearFrames()

Deletes all key frames.

public override void ClearFrames()

ClearTiles()

Removes all tiles.

public void ClearTiles()

ContainsTile(Tile)

Returns true if the tile appears on this layer.

public bool ContainsTile(Tile tile)

Parameters

tile Tile

Returns

bool

DeepCopy()

Creates a deep copy of the Layer.

public override Layer DeepCopy()

Returns

Layer

DeleteKeyFrameNoEvent(int)

Deletes the key frame at the given frame index, if there is one, in which case it returns that key frame. Otherwise it returns null.

protected override AnimationKeyFrame DeleteKeyFrameNoEvent(int keyframe)

Parameters

keyframe int

Returns

AnimationKeyFrame

ExtendNoEvent(int, int, int, int)

Extends the dimensions of the layer in each direction by the given amounts, but does not invoke the onPixelsChanged event.

protected override void ExtendNoEvent(int left, int right, int up, int down)

Parameters

left int
right int
up int
down int

FlipNoEvent(CardinalAxis)

Flips the layer, but does not invoke the onPixelsChanged event.

protected override void FlipNoEvent(CardinalAxis axis)

Parameters

axis CardinalAxis

GetLinkedPixels(IntVector2)

Get the pixels that are linked to the given pixel due to multiple tiles having the same file - i.e. they point to the same pixel within the tiles' file.

public IEnumerable<IntVector2> GetLinkedPixels(IntVector2 pixel)

Parameters

pixel IntVector2

Returns

IEnumerable<IntVector2>

GetLinkedPixels(IEnumerable<IntVector2>)

Get the pixels that are linked to the given pixels due to multiple tiles having the same file - i.e. they point to the same pixels within the tiles' file.

public IEnumerable<IntVector2> GetLinkedPixels(IEnumerable<IntVector2> pixels)

Parameters

pixels IEnumerable<IntVector2>

Returns

IEnumerable<IntVector2>

GetPixel(IntVector2, int, bool)

Gets the colour of the pixel.

public override Color GetPixel(IntVector2 pixel, int frame, bool useLayerOpacity = true)

Parameters

pixel IntVector2
frame int
useLayerOpacity bool

Returns

Color

PixelToTile(IntVector2)

Gets the tile that the pixel lands in, or null if there isn't one.

public Tile PixelToTile(IntVector2 pixel)

Parameters

pixel IntVector2

Returns

Tile

PixelToTile(int, int)

Gets the tile that the pixel (x, y) lands in, or null if there isn't one.

public Tile PixelToTile(int x, int y)

Parameters

x int
y int

Returns

Tile

RemoveTile(Tile)

Removes the tile from the layer. Throws an error if the tile is not in the layer.

public void RemoveTile(Tile tile)

Parameters

tile Tile

RerenderKeyFrame(int)

Rerenders the keyframe.

public void RerenderKeyFrame(int frame)

Parameters

frame int

RerenderKeyFrame(int, IntRect)

Rerenders the section of the keyframe within the given rect.

public void RerenderKeyFrame(int frame, IntRect rect)

Parameters

frame int
rect IntRect

RerenderKeyFrame(int, IEnumerable<IntVector2>)

Rerenders the given pixels of the keyframe.

public void RerenderKeyFrame(int frame, IEnumerable<IntVector2> pixels)

Parameters

frame int
pixels IEnumerable<IntVector2>

RerenderKeyFrames()

Rerenders all keyframes.

public void RerenderKeyFrames()

RerenderKeyFrames(IntRect)

Rerenders the section of every keyframe within the given rect.

public void RerenderKeyFrames(IntRect rect)

Parameters

rect IntRect

RerenderKeyFrames(IEnumerable<IntVector2>)

Rerenders the given pixels of every keyframe.

public void RerenderKeyFrames(IEnumerable<IntVector2> pixels)

Parameters

pixels IEnumerable<IntVector2>

RerenderKeyFrames(int[])

Rerenders the given keyframes.

public void RerenderKeyFrames(int[] keyFrames)

Parameters

keyFrames int[]

RerenderKeyFrames(int[], IntRect)

Rerenders the section of the given keyframes within the given rect.

public void RerenderKeyFrames(int[] keyFrames, IntRect rect)

Parameters

keyFrames int[]
rect IntRect

RerenderKeyFrames(int[], IEnumerable<IntVector2>)

Rerenders the given pixels of the given keyframes.

public void RerenderKeyFrames(int[] keyFrames, IEnumerable<IntVector2> pixels)

Parameters

keyFrames int[]
pixels IEnumerable<IntVector2>

RotateNoEvent(QuadrantalAngle)

Rotates the layer, but does not invoke the onPixelsChanged event. Rotation is clockwise.

protected override void RotateNoEvent(QuadrantalAngle angle)

Parameters

angle QuadrantalAngle

ScaleNoEvent(int, int)

Resizes the dimensions to the new width and height, but does not invoke the onPixelsChanged event.

protected override void ScaleNoEvent(int newWidth, int newHeight)

Parameters

newWidth int
newHeight int

ScaleNoEvent(float, float)

Resizes the dimensions of the file by the scale factors, but does not invoke the onPixelsChanged event.

protected override void ScaleNoEvent(float xScaleFactor, float yScaleFactor)

Parameters

xScaleFactor float
yScaleFactor float

SetPixelsNoEvent(IEnumerable<IntVector2>, int, Color, AnimFrameRefMode)

Sets the colour of the pixels. You do not need to check the pixels are in the layer as this check is done in Layer.SetPixels(), which is the only way this method is called.

protected override IEnumerable<IntVector2> SetPixelsNoEvent(IEnumerable<IntVector2> pixels, int frame, Color colour, AnimFrameRefMode frameRefMode)

Parameters

pixels IEnumerable<IntVector2>
frame int
colour Color
frameRefMode AnimFrameRefMode

Returns

IEnumerable<IntVector2>