Catlike Coding
Unity Code Documentation
Public Member Functions | Public Attributes | List of all members
CatlikeCoding.NumberFlow.DiagramPixels Class Reference

Container for NumberFlow pixel input data. More...

Public Member Functions

 DiagramPixels ()
 Initialize a new instance. There is no reason to do this yourself. More...
 
 DiagramPixels (DiagramPixels pixels)
 Initializes a new instance as a copy of another. There is no reason to do this yourself. More...
 
void Init (int width, int height, Color[] colors)
 Initialize a Color array, representing a pixel grid. More...
 
void Init (int size, Color[] colors)
 Initialize a Color array, representing a square pixel grid. More...
 

Public Attributes

Color[] colors
 Color array to use instead of the texture. More...
 
int height
 Height, used for the Color array. More...
 
Texture2D texture
 Texture2D that will be used, unless colors are provided. More...
 
int width
 Width, used for the Color array. More...
 

Detailed Description

Container for NumberFlow pixel input data.

Can be used to reference a Texture2D, or a Color array at runtime.

Colors will be used when the array is not null and both width and height are larger than zero. Otherwise it will fall back to the texture, if any.

Constructor & Destructor Documentation

CatlikeCoding.NumberFlow.DiagramPixels.DiagramPixels ( )

Initialize a new instance. There is no reason to do this yourself.

CatlikeCoding.NumberFlow.DiagramPixels.DiagramPixels ( DiagramPixels  pixels)

Initializes a new instance as a copy of another. There is no reason to do this yourself.

Parameters
pixelsDiagramPixels instance to copy.

Member Function Documentation

void CatlikeCoding.NumberFlow.DiagramPixels.Init ( int  width,
int  height,
Color[]  colors 
)

Initialize a Color array, representing a pixel grid.

The Color array length should be width * height.

Parameters
widthWidth.
heightHeight.
colorsColors.
void CatlikeCoding.NumberFlow.DiagramPixels.Init ( int  size,
Color[]  colors 
)

Initialize a Color array, representing a square pixel grid.

Sets both width and height to size. The Color array length should be size squared.

Parameters
sizeSize, to use for both width and height.
colorsColors.

Member Data Documentation

Color [] CatlikeCoding.NumberFlow.DiagramPixels.colors

Color array to use instead of the texture.

Its length should be width * height.

int CatlikeCoding.NumberFlow.DiagramPixels.height

Height, used for the Color array.

Texture2D CatlikeCoding.NumberFlow.DiagramPixels.texture

Texture2D that will be used, unless colors are provided.

int CatlikeCoding.NumberFlow.DiagramPixels.width

Width, used for the Color array.