Example #1
0
        public SizeTexture Write(TextureBase texture, int width, int height, out Vector2 uv, out Vector2 uvSize, out AvailableSpace usingAvailableSpace)
        {
            foreach (var sizeTexture in textures)
            {
                if (sizeTexture.Write(texture, width, height, out uv, out uvSize, out usingAvailableSpace))
                {
                    return(sizeTexture);
                }
            }
            var newSizeTexture = new SizeTexture(device);

            textures.Add(newSizeTexture);
            newSizeTexture.Write(texture, width, height, out uv, out uvSize, out usingAvailableSpace);
            return(newSizeTexture);
        }
Example #2
0
 public AvailableSpace(SizeTexture sizeTexture, Point position, Size2 size)
 {
     this.sizeTexture = sizeTexture;
     Position         = position;
     Size             = size;
 }