Class TextureCreator
This class dynamically creates textures at runtime. For example, we take
textures like hexagons as input and print a variable number of pins onto it.
The class also uses the generated textures to create materials.
Inheritance
object
TextureCreator
Assembly: .dll
Syntax
public static class TextureCreator
Fields
|
Edit this page
View Source
hexagonCircMaterials
Declaration
public static Dictionary<int, Material> hexagonCircMaterials
Field Value
Type |
Description |
Dictionary<int, Material> |
|
|
Edit this page
View Source
hexagonCircTexture
Declaration
private static Texture2D hexagonCircTexture
Field Value
Type |
Description |
Texture2D |
|
|
Edit this page
View Source
hexagonCircTextures
Declaration
public static Dictionary<int, Texture2D> hexagonCircTextures
Field Value
Type |
Description |
Dictionary<int, Texture2D> |
|
|
Edit this page
View Source
hexagonMaterials
Declaration
public static Dictionary<int, Material> hexagonMaterials
Field Value
Type |
Description |
Dictionary<int, Material> |
|
|
Edit this page
View Source
hexagonTexture
Declaration
private static Texture2D hexagonTexture
Field Value
Type |
Description |
Texture2D |
|
|
Edit this page
View Source
hexagonTextures
Declaration
public static Dictionary<int, Texture2D> hexagonTextures
Field Value
Type |
Description |
Dictionary<int, Texture2D> |
|
|
Edit this page
View Source
pinBorderCircTextures3Pins1
Declaration
public static Dictionary<int, Texture2D> pinBorderCircTextures3Pins1
Field Value
Type |
Description |
Dictionary<int, Texture2D> |
|
|
Edit this page
View Source
pinBorderCircTextures3Pins2
Declaration
public static Dictionary<int, Texture2D> pinBorderCircTextures3Pins2
Field Value
Type |
Description |
Dictionary<int, Texture2D> |
|
|
Edit this page
View Source
pinBorderCircTextures5Pins1
Declaration
public static Dictionary<int, Texture2D> pinBorderCircTextures5Pins1
Field Value
Type |
Description |
Dictionary<int, Texture2D> |
|
|
Edit this page
View Source
pinBorderCircTextures5Pins2
Declaration
public static Dictionary<int, Texture2D> pinBorderCircTextures5Pins2
Field Value
Type |
Description |
Dictionary<int, Texture2D> |
|
|
Edit this page
View Source
pinBorderHexCircMaterials
Declaration
public static Dictionary<int, Material> pinBorderHexCircMaterials
Field Value
Type |
Description |
Dictionary<int, Material> |
|
|
Edit this page
View Source
pinBorderHexMaterials
Declaration
public static Dictionary<int, Material> pinBorderHexMaterials
Field Value
Type |
Description |
Dictionary<int, Material> |
|
|
Edit this page
View Source
pinBorderTextureEmpty
Declaration
public static Texture2D pinBorderTextureEmpty
Field Value
Type |
Description |
Texture2D |
|
|
Edit this page
View Source
pinBorderTextures3Pins1
Declaration
public static Dictionary<int, Texture2D> pinBorderTextures3Pins1
Field Value
Type |
Description |
Dictionary<int, Texture2D> |
|
|
Edit this page
View Source
pinBorderTextures3Pins2
Declaration
public static Dictionary<int, Texture2D> pinBorderTextures3Pins2
Field Value
Type |
Description |
Dictionary<int, Texture2D> |
|
|
Edit this page
View Source
pinBorderTextures5Pins1
Declaration
public static Dictionary<int, Texture2D> pinBorderTextures5Pins1
Field Value
Type |
Description |
Dictionary<int, Texture2D> |
|
|
Edit this page
View Source
pinBorderTextures5Pins2
Declaration
public static Dictionary<int, Texture2D> pinBorderTextures5Pins2
Field Value
Type |
Description |
Dictionary<int, Texture2D> |
|
|
Edit this page
View Source
pinTexture
Declaration
private static Texture2D pinTexture
Field Value
Type |
Description |
Texture2D |
|
|
Edit this page
View Source
transTexture
Declaration
private static Texture2D transTexture
Field Value
Type |
Description |
Texture2D |
|
Methods
|
Edit this page
View Source
GetHexagonBaseTextureWithPins(int, ViewType)
Creates a texture from one of the base hexagon textures
and dots which represent the pins.
The pins are merged on top of the original hexagon to get a figure with pins.
Declaration
private static Texture2D GetHexagonBaseTextureWithPins(int pinsPerSide, ViewType viewType)
Parameters
Type |
Name |
Description |
int |
pinsPerSide |
The amount of pins per side.
|
ViewType |
viewType |
The view type, e.g. the standard hexagon or the circular view.
Please only use Hexagonal and HexagonalCirc here (the hexagonal base grid view),
Circular (the graph view) is not meant to work.
|
Returns
Type |
Description |
Texture2D |
A texture containing a hexagon or circle based on
viewType with pinsPerSide pins
on each of its six edges.
|
|
Edit this page
View Source
GetHexagonWithPinsMaterial(int, ViewType)
Declaration
public static Material GetHexagonWithPinsMaterial(int pinsPerSide, ViewType viewType)
Parameters
Type |
Name |
Description |
int |
pinsPerSide |
The amount of pins per side.
|
ViewType |
viewType |
The view type, Hexagonal or HexagonalCirc, not Circular!
|
Returns
Type |
Description |
Material |
The material used to draw particles with
pinsPerSide pins in the hexagonal view type
viewType .
|
|
Edit this page
View Source
GetPinBorderMaterial(int, ViewType)
Declaration
public static Material GetPinBorderMaterial(int pinsPerSide, ViewType viewType)
Parameters
Type |
Name |
Description |
int |
pinsPerSide |
The amount of pins per side.
|
ViewType |
viewType |
The view type, Hexagonal or HexagonalCirc, not Circular!
|
Returns
Type |
Description |
Material |
A material that only renders pins, only while the
particle is not moving.
|
|
Edit this page
View Source
GetPinBorderTexture(int, bool, bool, int, bool, ViewType)
This thing creates a texture from a transparent texture and dots which represent the pins.
The pins are merged on top of the original transparent texture to get a texture with pins.
This is done to lay this texture with a mesh on top of the original hexagon, so we can fit
circuits in between the two meshes and give the impression that all is one connected component.
Declaration
private static Texture2D GetPinBorderTexture(int pinsPerSide, bool omitSide, bool omit3Pins, int omittedSide, bool isTex1, ViewType viewType)
Parameters
Type |
Name |
Description |
int |
pinsPerSide |
The amount of pins per side.
|
bool |
omitSide |
Whether one side's pins should be omitted.
|
bool |
omit3Pins |
Whether three pins should be omitted (the
omittedSide and the two neighboring sides).
|
int |
omittedSide |
The side of the omitted pin/s.
|
bool |
isTex1 |
Whether this is texture 1 of the 2 possible texture positions in the
final shader. One of the two textures is used for the stationary part and one for the
moving part during an animation.
|
ViewType |
viewType |
The type of the base hexagon texture. Circular and hexagonal forms
have different pin positions. Accepted inputs: Hexagonal or HexagonalCirc, but not Circular!
|
Returns
Type |
Description |
Texture2D |
A transparent texture with the specified pins.
|
|
Edit this page
View Source
GetPinBorderTextureEmpty()
Declaration
private static Texture2D GetPinBorderTextureEmpty()
Returns
Type |
Description |
Texture2D |
|