Exemplo n.º 1
0
 public void Produce(SKCanvas graphics,
                     TileTextureCollection c)
 {
     foreach (var g in c.Grids)
     {
         var node    = new TextureGridLayoutNode(prefs, g);
         var painter = new TextureGridPainter(prefs, node);
         painter.Draw(graphics);
     }
 }
Exemplo n.º 2
0
        public IntDimension ComputeRenderedSize(TileTextureCollection c)
        {
            var width  = 0;
            var height = 0;

            foreach (var grid in c.Grids)
            {
                var node = new TextureGridLayoutNode(prefs, grid);
                var p    = node.Offset + node.Size;
                width  = Math.Max(p.X, width);
                height = Math.Max(p.Y, height);
            }

            return(new IntDimension(width, height));
        }
Exemplo n.º 3
0
 public TextureGridPainter(GeneratorPreferences prefs, TextureGridLayoutNode node)
 {
     this.prefs = prefs;
     this.node  = node ?? throw new ArgumentNullException(nameof(node));
     this.grid  = node.Grid;
 }