Class Layer
Contains a single layer of pixels of a sprite.
Inheritance
System.Object
Layer
Namespace: InsaneScatterbrain.RetroKit.Editor
Syntax
[Serializable]
public class Layer : ISerializationCallbackReceiver
Constructors
Layer(Layer)
Creates a copy of the existing layer.
Declaration
public Layer(Layer existingLayer)
Parameters
Type | Name | Description |
---|---|---|
Layer | existingLayer |
Layer(Int32, Int32)
Declaration
public Layer(int width, int height)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | width | |
System.Int32 | height |
Fields
colors
Colors for each pixel within this layer, indexed by x and y coordinates.
Declaration
public int[, ] colors
Field Value
Type | Description |
---|---|
System.Int32[,] |
Properties
Item[Int32, Int32]
Gets/sets the color index at the given coordinates.
Declaration
public int this[int x, int y] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | x | The x-coordinate. |
System.Int32 | y | The y-coordinate. |
Property Value
Type | Description |
---|---|
System.Int32 |
Item[Vector2Int]
Gets/sets the color index at the given coordinates.
Declaration
public int this[Vector2Int index] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Vector2Int | index | The x and y coordinates. |
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
OnAfterDeserialize()
Declaration
public void OnAfterDeserialize()
OnBeforeSerialize()
Declaration
public void OnBeforeSerialize()