Пример #1
0
        private void LoadTextures()
        {
            string texPath   = Path.Combine(Content.RootDirectory, "Textures");
            string cachePath = Path.Combine(Content.RootDirectory, "Textures/Cache");

            _atlas = new Atlas(GraphicsDevice, new DirectoryInfo(texPath), new DirectoryInfo(cachePath));
            _atlas.Load(null);

            var grayscale = _atlas.GetRegion("grayscale");

            _whitePixel = new TextureRegion2D(
                grayscale.Texture, new RectangleF(grayscale.X + 1, grayscale.Y + 1, 1, 1));

            _tileRegions = new Dictionary <int, string>()
            {
                { 1, "Tiles/sand" },
                { 2, "Tiles/gravel" },
                { 3, "Tiles/grass" },
            };
        }
Пример #2
0
 public ReadOnlyWrapper(Atlas atlas)
 {
     _atlas = atlas;
 }