Example #1
0
 private static Vector GetUnitSize(IVector size) => (1f / (Vector)(size));
Example #2
0
 public static IVector AnchorComponent(Component c, IVector desiredPosition, AnchorX xAnchor, AnchorY yAnchor) => Anchor(c.Size, desiredPosition, xAnchor, yAnchor);
Example #3
0
 public void Set(IVector v, char c)
 {
     grid[v.x, v.y].Character = c;
 }
Example #4
0
 public void Set(IVector v, char c, Color backgroundColor)
 {
     grid[v.x, v.y].Character       = c;
     grid[v.x, v.y].backgroundColor = backgroundColor;
 }
Example #5
0
 public CBuffer(IVector size)
 {
     Resize(size);
 }
Example #6
0
 public void DrawHollowRectangle(IVector start, IVector size, Color backgroundColor, char c = ' ')
 {
     DrawHollowRectangleTo(start, start + size, backgroundColor, c);
 }
Example #7
0
 public void DrawRectangle(IVector start, IVector end, Color backgroundColor)
 {
     DrawRectangleTo(start, start + end, backgroundColor);
 }
Example #8
0
 public void DrawRectangle(IVector start, IVector end, Color foregroundColor, Color backgroundColor, char fillCharacter = ' ')
 {
     DrawRectangleTo(start, start + end, foregroundColor, backgroundColor, fillCharacter);
 }
Example #9
0
        //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];
                }
            }
        }