Пример #1
0
        public RegionAttachment NewRegionAttachment(Skin skin, string name, string path)
        {
            AtlasRegion region = FindRegion(path);

            if (region == null)
            {
                throw new ArgumentException(string.Format("Region not found in atlas: {0} (region attachment: {1})", path, name));
            }
            RegionAttachment attachment = new RegionAttachment(name);

            attachment.RendererObject = region;
            attachment.SetUVs(region.u, region.v, region.u2, region.v2, region.rotate);
            attachment.regionOffsetX        = region.offsetX;
            attachment.regionOffsetY        = region.offsetY;
            attachment.regionWidth          = region.width;
            attachment.regionHeight         = region.height;
            attachment.regionOriginalWidth  = region.originalWidth;
            attachment.regionOriginalHeight = region.originalHeight;
            return(attachment);
        }