Esempio n. 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; }
    }
Esempio n. 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;
            }
        }
Esempio n. 4
0
 internal static SpriteItem Create(IMappedImageInfo item, SpriteInfo sprite)
 {
     return(new SpriteItem((ImageInfo)item.ImageInfo, new Point(item.X, item.Y), sprite));
 }
Esempio n. 5
0
 internal static SpriteItem Create( IMappedImageInfo item, SpriteInfo sprite )
 {
   return new SpriteItem( (ImageInfo) item.ImageInfo, new Point( item.X, item.Y ), sprite );
 }