internal static SpriteInfo Create(MappedImageCollection mappedResult) { var info = new SpriteInfo(); var items = mappedResult.MappedImages.Select(item => SpriteItem.Create(item, info)).ToArray(); return(new SpriteInfo { Size = new Size(mappedResult.Width, mappedResult.Height), Items = items }); }
internal static SpriteInfo Create( MappedImageCollection mappedResult ) { var info = new SpriteInfo(); var items = mappedResult.MappedImages.Select( item => SpriteItem.Create( item, info ) ).ToArray(); return new SpriteInfo { Size = new Size( mappedResult.Width, mappedResult.Height ), Items = items }; }
private static SpriteInfo CreateSprite(string path) { var images = Directory.EnumerateFiles(path, "*") .Select(filepath => ImageInfo.Create(filepath)) .Where(item => item != null).ToArray(); if (images.Any() == false) { return(null); } var mapper = new MapperOptimalEfficiency <MappedImageCollection>(new Canvas()); var sprite = mapper.Mapping(images); return(SpriteInfo.Create(sprite)); }
internal static SpriteItem Create(IMappedImageInfo item, SpriteInfo sprite) { return(new SpriteItem((ImageInfo)item.ImageInfo, new Point(item.X, item.Y), sprite)); }
private SpriteItem(ImageInfo image, Point offset, SpriteInfo sprite) { ImageInfo = image; Offset = offset; SpriteInfo = sprite; }
internal static SpriteItem Create( IMappedImageInfo item, SpriteInfo sprite ) { return new SpriteItem( (ImageInfo) item.ImageInfo, new Point( item.X, item.Y ), sprite ); }
private SpriteItem( ImageInfo image, Point offset, SpriteInfo sprite ) { ImageInfo = image; Offset = offset; SpriteInfo = sprite; }
public SpriteInfo CreateSprite() { return(SpriteInfo.Create(this)); }