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
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
NormalLayer(string, int, int)
public NormalLayer(string name, int width, int height)
Parameters
NormalLayer(string, Texture2D)
public NormalLayer(string name, Texture2D texture)
Parameters
name
stringtexture
Texture2D
NormalLayer(Texture2D)
public NormalLayer(Texture2D texture)
Parameters
texture
Texture2D
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
keyframe
int
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, FlipDirection, AnimFrameRefMode)
Flips the given frame of the layer.
public void Flip(int frame, FlipDirection direction, AnimFrameRefMode frameRefMode)
Parameters
frame
intdirection
FlipDirectionframeRefMode
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
IntVector2frame
intuseLayerOpacity
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
intoffset
IntVector2frameRefMode
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
intoverlayTex
Texture2Doffset
IntVector2frameRefMode
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
intoverlayTex
Texture2DframeRefMode
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
Texture2Doffset
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
intangle
RotationAngleframeRefMode
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
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(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
intcolour
ColorframeRefMode
AnimFrameRefMode
Returns
SetTexture(int, Texture2D, AnimFrameRefMode)
Sets the texture at the given frame.
public void SetTexture(int frame, Texture2D texture, AnimFrameRefMode frameRefMode)
Parameters
frame
inttexture
Texture2DframeRefMode
AnimFrameRefMode