public void AddMappedImage(IMappedImageInfo imageLocation) { MappedImages.Add(imageLocation); Height = Math.Max(Height, imageLocation.Y + imageLocation.ImageInfo.Height); Width = Math.Max(Width, imageLocation.X + imageLocation.ImageInfo.Width); }
/// <summary> /// Adds a Rectangle to the SpriteInfo, and updates the width and height of the SpriteInfo. /// </summary> /// <param name="imageLocation"></param> public void AddMappedImage( IMappedImageInfo imageLocation ) { _mappedImages.Add( imageLocation ); IImageInfo newImage = imageLocation.ImageInfo; int highestY = imageLocation.Y + newImage.Height; int rightMostX = imageLocation.X + newImage.Width; if ( _height < highestY ) { _height = highestY; } if ( _width < rightMostX ) { _width = rightMostX; } }
/// <summary> /// Adds a Rectangle to the SpriteInfo, and updates the width and height of the SpriteInfo. /// </summary> /// <param name="imageLocation"></param> public void AddMappedImage(IMappedImageInfo imageLocation) { _mappedImages.Add(imageLocation); IImageInfo newImage = imageLocation.ImageInfo; int highestY = imageLocation.Y + newImage.Height; int rightMostX = imageLocation.X + newImage.Width; if (_height < highestY) { _height = highestY; } if (_width < rightMostX) { _width = rightMostX; } }
internal static SpriteItem Create(IMappedImageInfo item, SpriteInfo sprite) { return(new SpriteItem((ImageInfo)item.ImageInfo, new Point(item.X, item.Y), sprite)); }
internal static SpriteItem Create( IMappedImageInfo item, SpriteInfo sprite ) { return new SpriteItem( (ImageInfo) item.ImageInfo, new Point( item.X, item.Y ), sprite ); }