private static Vector GetUnitSize(IVector size) => (1f / (Vector)(size));
public static IVector AnchorComponent(Component c, IVector desiredPosition, AnchorX xAnchor, AnchorY yAnchor) => Anchor(c.Size, desiredPosition, xAnchor, yAnchor);
public void Set(IVector v, char c) { grid[v.x, v.y].Character = c; }
public void Set(IVector v, char c, Color backgroundColor) { grid[v.x, v.y].Character = c; grid[v.x, v.y].backgroundColor = backgroundColor; }
public CBuffer(IVector size) { Resize(size); }
public void DrawHollowRectangle(IVector start, IVector size, Color backgroundColor, char c = ' ') { DrawHollowRectangleTo(start, start + size, backgroundColor, c); }
public void DrawRectangle(IVector start, IVector end, Color backgroundColor) { DrawRectangleTo(start, start + end, backgroundColor); }
public void DrawRectangle(IVector start, IVector end, Color foregroundColor, Color backgroundColor, char fillCharacter = ' ') { DrawRectangleTo(start, start + end, foregroundColor, backgroundColor, fillCharacter); }
//public static Vector GenerateScreenSize (Vector pixelSize) => new Vector (pixelSize.x / Dae.UnitPixelSize.x, pixelSize.y / Dae.UnitPixelSize.y); public static void Blit(CBuffer from, CBuffer to, IVector fromStart, IVector fromEnd, IVector toStart) { for (int fy = fromStart.y; fy < fromEnd.y && fy + toStart.y < to.Size.y; fy++) { for (int fx = fromStart.x; fx < fromEnd.x && fx + toStart.x < to.Size.x; fx++) { IVector fLoc = new IVector(fx, fy); IVector toLoc = toStart + fLoc; // Assignment to[toLoc] = from[fLoc]; } } }