Table of Contents

Class NormalLayer

Namespace
PAC.Layers

A class to represent a normal layer - one that can be drawn on as a regular image.

public class NormalLayer : Layer
Inheritance
NormalLayer
Inherited Members

Constructors

NormalLayer(NormalLayer)

Creates a deep copy of the NormalLayer.

public NormalLayer(NormalLayer layer)

Parameters

layer NormalLayer

NormalLayer(int, int)

public NormalLayer(int width, int height)

Parameters

width int
height int

NormalLayer(string, int, int)

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

Parameters

name string
width int
height int

NormalLayer(string, Texture2D)

public NormalLayer(string name, Texture2D texture)

Parameters

name string
texture Texture2D

NormalLayer(Texture2D)

public NormalLayer(Texture2D texture)

Parameters

texture Texture2D

Properties

layerType

public override LayerType layerType { get; }

Property Value

LayerType

Methods

ClearFrames()

Deletes all key frames.

public override void ClearFrames()

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

Flip(int, FlipDirection, AnimFrameRefMode)

Flips the given frame of the layer.

public void Flip(int frame, FlipDirection direction, AnimFrameRefMode frameRefMode)

Parameters

frame int
direction FlipDirection
frameRefMode AnimFrameRefMode

FlipNoEvent(FlipDirection)

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

protected override void FlipNoEvent(FlipDirection direction)

Parameters

direction FlipDirection

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

Offset(IntVector2)

Offsets the texture of every frame. (Moves the texture so the bottom-left corner is at the coordinates 'offset'.

public void Offset(IntVector2 offset)

Parameters

offset IntVector2

Offset(int, IntVector2, AnimFrameRefMode)

Offsets the texture at the given frame. (Moves the texture so the bottom-left corner is at the coordinates 'offset'.

public void Offset(int frame, IntVector2 offset, AnimFrameRefMode frameRefMode)

Parameters

frame int
offset IntVector2
frameRefMode AnimFrameRefMode

OverlayTexture(int, Texture2D, IntVector2, AnimFrameRefMode)

Overlays the texture onto the given frame, placing the bottom-left corner at the coordinates 'offset' (which don't have to be within the image). Uses Normal blend mode.

public void OverlayTexture(int frame, Texture2D overlayTex, IntVector2 offset, AnimFrameRefMode frameRefMode)

Parameters

frame int
overlayTex Texture2D
offset IntVector2
frameRefMode AnimFrameRefMode

OverlayTexture(int, Texture2D, AnimFrameRefMode)

Overlays the texture onto the given frame. Uses Normal blend mode.

public void OverlayTexture(int frame, Texture2D overlayTex, AnimFrameRefMode frameRefMode)

Parameters

frame int
overlayTex Texture2D
frameRefMode AnimFrameRefMode

OverlayTexture(Texture2D)

Overlays the texture onto every frame. Uses Normal blend mode.

public void OverlayTexture(Texture2D overlayTex)

Parameters

overlayTex Texture2D

OverlayTexture(Texture2D, IntVector2)

Overlays the texture onto every frame, placing the bottom-left corner at the coordinates 'offset' (which don't have to be within the image). Uses Normal blend mode.

public void OverlayTexture(Texture2D overlayTex, IntVector2 offset)

Parameters

overlayTex Texture2D
offset IntVector2

Rotate(int, RotationAngle, AnimFrameRefMode)

Rotates the given frame of the layer. Rotation is clockwise.

public void Rotate(int frame, RotationAngle angle, AnimFrameRefMode frameRefMode)

Parameters

frame int
angle RotationAngle
frameRefMode AnimFrameRefMode

RotateNoEvent(RotationAngle)

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

protected override void RotateNoEvent(RotationAngle angle)

Parameters

angle RotationAngle

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(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 IntVector2[] SetPixelsNoEvent(IntVector2[] pixels, int frame, Color colour, AnimFrameRefMode frameRefMode)

Parameters

pixels IntVector2[]
frame int
colour Color
frameRefMode AnimFrameRefMode

Returns

IntVector2[]

SetTexture(int, Texture2D, AnimFrameRefMode)

Sets the texture at the given frame.

public void SetTexture(int frame, Texture2D texture, AnimFrameRefMode frameRefMode)

Parameters

frame int
texture Texture2D
frameRefMode AnimFrameRefMode