Beispiel #1
0
		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; }
    }
Beispiel #3
0
        /// <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;
            }
        }
Beispiel #4
0
 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 );
 }