Exemplo n.º 1
0
 // convenience for types that use the same texture on top and bottom (a lot of natural materials, for example)
 public TBSCVoxelSkin(TileTexture topBottomTexture, TileTexture sideTexture, TileTexture cornerTexture)
 {
     TopTexture    = topBottomTexture;
     BottomTexture = topBottomTexture;
     SideTexture   = sideTexture;
     CornerTexture = cornerTexture;
 }
Exemplo n.º 2
0
        public void AddTileTexture(TileTexture tile)
        {
            var t = tile.Texture;

            if (t.Width != t.Height)
            {
                Logger.Error(this, $"Can't add texture {t.Name} to atlas: Not square {t.Width}x{t.Height}");
                return;
            }
            if (TilePixelWidth == -1)
            {
                TilePixelWidth = t.Width;
            }
            else if (TilePixelWidth != t.Width)
            {
                Logger.Error(this, $"Can't add texture {t.Name} to atlas: Width {t.Width} is not expected {TilePixelWidth}");
                return;
            }
            _tiles.Add(t.Name, tile);
        }
Exemplo n.º 3
0
 public SingleVoxelSkin(TileTexture texture)
 {
     this.Texture = texture;
 }
Exemplo n.º 4
0
 public ColumnVoxelSkin(TileTexture top, TileTexture bottom, TileTexture side)
 {
     TopTexture    = top;
     BottomTexture = bottom;
     SideTexture   = side;
 }