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