Beispiel #1
0
        public void CalculateSteps()
        {
            // Force the color chip to not replace empty colors with background value
            colorChip.debugMode = true;

            var colors = colorChip.colors;
            var total  = colors.Length;

            var width  = 8;
            var height = (int)Math.Ceiling(total / (float)width);

            var totalPixels = width * height;

            var pixels = new int[totalPixels];

            for (int i = 0; i < totalPixels; i++)
            {
                if (i < total)
                {
                    pixels[i] = i;
                }
                else
                {
                    pixels[i] = -1;
                }
            }

            exporter = new PixelDataExporter(fullFileName, pixels, width, height, colors, textureFactory);

            // Reset color chip value
            colorChip.debugMode = false;

            exporter.CalculateSteps();
        }
Beispiel #2
0
        public void CalculateSteps()
        {
            // Force the color chip to not replace empty colors with background value
            colorChip.debugMode = true;

            ConfigureColors();

            // Reset color chip value
            colorChip.debugMode = false;

            BuildPixelData();

            // Create Pixel Data Exporter
            exporter = new PixelDataExporter(fullFileName, pixels, width, height, colors, imageExporter);

            // calculate steps for exporter
            exporter.CalculateSteps();
        }
Beispiel #3
0
        public void CalculateSteps()
        {
            var cols = 16;
            var rows = MathUtil.CeilToInt(totalFlags / (float)cols);

            var w = cols * tileSize.x;
            var h = rows * tileSize.y;

            var canvas = new Pattern(w, h);

            canvas.Clear();

            var totalPixels = tileSize.x * tileSize.y;

            var brush = new int[totalPixels];

            IColor[] colors = new IColor[totalFlags];

            var flagColors = flagColorChip.colors;

            for (int i = 0; i < totalFlags; i++)
            {
                colors[i] = flagColors[i];

                var pos = gameChip.CalculatePosition(i, w);

                pos.x *= tileSize.x;
                pos.y *= tileSize.y;
                // Update the brush
                for (int j = 0; j < totalPixels; j++)
                {
                    brush[j] = i;
                }

                canvas.SetPixels(pos.x, pos.y, tileSize.x, tileSize.y, brush);
            }
            var imageExporter = new PNGWriter();

            exporter = new PixelDataExporter(fullFileName, canvas.pixels, w, h, colors, imageExporter);

            exporter.CalculateSteps();
        }
 public void CalculateSteps()
 {
     exporter.CalculateSteps();
 }
Beispiel #5
0
        public virtual void CalculateSteps()
        {
            ConfigurePixelData();

            exporter.CalculateSteps();
        }