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 Chexel getChexel(int x, int y) { if (hasShader) { return(shader.getChexel(x - xOffset, y - yOffset)); } if (!hasChexel(x, y)) { return(new Chexel()); } x -= xOffset; y -= yOffset; return(new Chexel(forground[x, y], background[x, y], text[x, y])); }