public static Frame FlattenFromChexelProvider(ChexelProvider top, Frame bottom) { int xMax = bottom.width + bottom.xOffset; int yMax = bottom.height + bottom.yOffset; Frame toReturn = new Frame(xMax, yMax, 0, 0); for (int x = 0; x < xMax; x++) { for (int y = 0; y < yMax; y++) { Chexel toSet = new Chexel(); if (top.hasChexel(x, y)) { toSet = top.getChexel(x, y); } else if (bottom.hasChexel(x, y)) { toSet = bottom.getChexel(x, y); } toReturn.setChexel(x, y, toSet); } } return(toReturn); }
public Frame(int width, int height, int xOffset, int yOffset) { this.width = width; this.height = height; this.xOffset = xOffset; this.yOffset = yOffset; this.useOffset = true; this.hasShader = false; shader = null; background = new ConsoleColor[width, height]; forground = new ConsoleColor[width, height]; text = new char[width, height]; isActive = true; for (int i = xOffset; i < width + xOffset; i++) { for (int j = yOffset; j < height + yOffset; j++) { setChexel(i, j, new Chexel()); } } }
public void addLayer(ChexelProvider layer) { layers.Add(layer); }