Ejemplo n.º 1
0
Archivo: Canvas.cs Proyecto: kijun/art
        public void Fill(Color color)
        {
            Rect rect = currZoomToWorldScale;
            var  rp   = new RectParams {
                position = rect.center, scale = rect.size, level = zoomStack.Count, color = color
            };

            var r = NoteFactory.CreateRect(rp);
            //rect = NodeFactory.CreateRect(
        }
Ejemplo n.º 2
0
    public void Initialize(GridRect rect, Board1 board)
    {
        //Debug.Log($"Creating GraphicEntity: {rect}");
        this.board = board;
        this.rect  = rect;
        board.LockTiles(rect, this);
        var rectParams = board.GridRectToRectParams(rect);

        animatable = NoteFactory.CreateRect(rectParams);
    }
Ejemplo n.º 3
0
Archivo: Agent.cs Proyecto: kijun/art
    /***** PUBLIC STATIC METHOD *****/
    public static Tile[,] CreateBoard(int cols, int rows, float length)
    {
        Debug.Log("Creating board " + cols + " " + rows);
        var board    = new Tile[cols, rows]; // x, y
        var diagonal = length * 1.414f;
        var xmin     = -(diagonal * (cols - 1)) / 2;
        var ymin     = -(diagonal * (rows - 1)) / 2;

        for (int i = 0; i < cols; i++)
        {
            for (int j = 0; j < rows; j++)
            {
                var rp = new RectParams {
                    x      = xmin + i * diagonal,
                    y      = ymin + j * diagonal,
                    width  = length,
                    height = length,
                    color  = new Color32(1, 104, 200, 255)
                };

                var anim = NoteFactory.CreateRect(rp);
                var tile = anim.gameObject.AddComponent <Tile>();
                board[i, j] = tile;
            }
        }

        for (int x = 0; x < cols; x++)
        {
            for (int y = 0; y < rows; y++)
            {
                var tile = (Tile)board.GetValue2(x, y);
                tile.AddAdjacentTile(Location.TopLeft, (Tile)board.GetValue2(x - 1, y - 1));
                tile.AddAdjacentTile(Location.Top, (Tile)board.GetValue2(x, y - 1));
                tile.AddAdjacentTile(Location.TopRight, (Tile)board.GetValue2(x + 1, y - 1));
                tile.AddAdjacentTile(Location.Left, (Tile)board.GetValue2(x - 1, y));
                tile.AddAdjacentTile(Location.Right, (Tile)board.GetValue2(x + 1, y));
                tile.AddAdjacentTile(Location.BottomLeft, (Tile)board.GetValue2(x - 1, y + 1));
                tile.AddAdjacentTile(Location.Bottom, (Tile)board.GetValue2(x, y + 1));
                tile.AddAdjacentTile(Location.BottomRight, (Tile)board.GetValue2(x + 1, y + 1));
            }
        }

        return(board);
    }
Ejemplo n.º 4
0
 void Start()
 {
     anim = NoteFactory.CreateRect(rp);
 }