Procedurality.Channel.toLayer C# (CSharp) Method

toLayer() public method

public toLayer ( ) : Layer
return Layer
		public Layer toLayer() {
			return new Layer(this, this, this);
		}
	

Usage Example

コード例 #1
0
ファイル: Main.cs プロジェクト: N3X15/Procedurality4NET
 private static void MakeTiles(Channel terrain, uint tsize, string path)
 {
     uint xmax = (uint)Math.Floor((float)terrain.Width / (float)tsize);
     uint ymax = (uint)Math.Floor((float)terrain.Height / (float)tsize);
     uint complete = 0;
     for (uint y = 0; y < ymax; y++)
     {
         for (uint x = 0; x < xmax; x++)
         {
             Channel tile = new Channel((int)tsize, (int)tsize);
             tile = terrain.copy().crop((int)(x * tsize), (int)(y * tsize), (int)((x + 1) * tsize), (int)((y + 1) * tsize));
             tile.toLayer().saveAsPNG(string.Format("{0}/SimTerrain-{1}-{2}.png"));
             complete++;
             drawTextProgressBar((int)complete, (int)(xmax + ymax));
         }
     }
 }