Class NormalLayer
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
- Extension Methods
Constructors
NormalLayer(NormalLayer)
Creates a deep copy of the NormalLayer.
public NormalLayer(NormalLayer layer)
Parameters
layerNormalLayer
NormalLayer(int, int)
public NormalLayer(int width, int height)
Parameters
NormalLayer(string, int, int)
public NormalLayer(string name, int width, int height)
Parameters
NormalLayer(string, Texture2D)
public NormalLayer(string name, Texture2D texture)
Parameters
namestringtextureTexture2D
NormalLayer(Texture2D)
public NormalLayer(Texture2D texture)
Parameters
textureTexture2D
Properties
layerType
public override LayerType layerType { get; }
Property Value
Methods
ClearFrames()
Deletes all key frames.
public override void ClearFrames()
DeepCopy()
Creates a deep copy of the Layer.
public override Layer DeepCopy()
Returns
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
keyframeint
Returns
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
Flip(int, CardinalAxis, AnimFrameRefMode)
Flips the given frame of the layer.
public void Flip(int frame, CardinalAxis axis, AnimFrameRefMode frameRefMode)
Parameters
frameintaxisCardinalAxisframeRefModeAnimFrameRefMode
FlipNoEvent(CardinalAxis)
Flips the layer, but does not invoke the onPixelsChanged event.
protected override void FlipNoEvent(CardinalAxis axis)
Parameters
axisCardinalAxis
GetPixel(IntVector2, int, bool)
Gets the colour of the pixel.
public override Color GetPixel(IntVector2 pixel, int frame, bool useLayerOpacity = true)
Parameters
pixelIntVector2frameintuseLayerOpacitybool
Returns
- Color
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
frameintoverlayTexTexture2DoffsetIntVector2frameRefModeAnimFrameRefMode
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
frameintoverlayTexTexture2DframeRefModeAnimFrameRefMode
OverlayTexture(Texture2D)
Overlays the texture onto every frame. Uses Normal blend mode.
public void OverlayTexture(Texture2D overlayTex)
Parameters
overlayTexTexture2D
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
overlayTexTexture2DoffsetIntVector2
Rotate(int, QuadrantalAngle, AnimFrameRefMode)
Rotates the given frame of the layer. Rotation is clockwise.
public void Rotate(int frame, QuadrantalAngle angle, AnimFrameRefMode frameRefMode)
Parameters
frameintangleQuadrantalAngleframeRefModeAnimFrameRefMode
RotateNoEvent(QuadrantalAngle)
Rotates the layer, but does not invoke the onPixelsChanged event. Rotation is clockwise.
protected override void RotateNoEvent(QuadrantalAngle angle)
Parameters
angleQuadrantalAngle
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
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
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
pixelsIEnumerable<IntVector2>frameintcolourColorframeRefModeAnimFrameRefMode
Returns
SetTexture(int, Texture2D, AnimFrameRefMode)
Sets the texture at the given frame.
public void SetTexture(int frame, Texture2D texture, AnimFrameRefMode frameRefMode)
Parameters
frameinttextureTexture2DframeRefModeAnimFrameRefMode