/// <summary> /// Initialize Texture from an image that has only a single Sprite /// </summary> /// <param name="imagePath">String Path to Texture</param> /// <param name="x">On screen TopLeft X Coordinate</param> /// <param name="y">On Screen TopLeft Y Coordinate</param> /// <param name="itemOrientation">Currently only Vertically Oriented</param> /// <param name="content">ContentManager that needs the texture to be loaded</param> public BackgroundItem(Texture2D spriteTex, Rectangle position, float itemOrientation) { this.Position = position; this.Orient = itemOrientation; SpriteTexture = spriteTex; Origin = new Vector2(0, 0); this.Flip = EnumSettings.ItemOrientation.DOWN; }
/// <summary> /// Initialize Texture from an image that has a set of Sprites in one image file /// Currently not implemented in Draw method but if needed will be very quick to add /// </summary> /// <param name="imagePath">String Path to Texture</param> /// <param name="x">On screen TopLeft X Coordinate</param> /// <param name="y">On Screen TopLeft Y Coordinate</param> /// <param name="itemOrientation">Currently only Vertically Oriented</param> /// <param name="content">ContentManager that needs the texture to be loaded</param> /// <param name="spriteBounds">Position of the sprite in a sprite sheet</param> public BackgroundItem(Texture2D spriteTex, Rectangle position, float itemOrientation, Vector2 origin) { this.Position = position; //this.Position = new Rectangle(0, 0, position.Width, position.Height); this.Orient = itemOrientation; SpriteTexture = spriteTex; this.Origin = origin; this.Flip = EnumSettings.ItemOrientation.DOWN; }