/// <summary> /// The same as SpriteAligned(Corner, float, float) but offset by a constant amount. /// </summary> /// <param name="spriteCorner"></param> /// <param name="proportionX"></param> /// <param name="proportionY"></param> /// <param name="offset"></param> /// <returns></returns> public static IPointLocator SpriteAligned(Corner spriteCorner, float proportionX, float proportionY, Point offset) { return(new AlignedSpriteLocator( Locators.AnimationBoundsPoint(proportionX, proportionY), Locators.SpriteBoundsPoint(spriteCorner), offset)); }
/// <summary> /// The same as SpriteAligned(Corner, Corner) but offset by a constant amount. /// </summary> /// <param name="spriteCorner"></param> /// <param name="animationCorner"></param> /// <param name="offset"></param> /// <returns></returns> public static IPointLocator SpriteAligned(Corner spriteCorner, Corner animationCorner, Point offset) { return(new AlignedSpriteLocator( Locators.AnimationBoundsPoint(animationCorner), Locators.SpriteBoundsPoint(spriteCorner), offset)); }
public override void Start() { base.Start(); if (this.AlignmentPointLocator == null) { this.AlignmentPointLocator = Locators.SpriteBoundsPoint(Corner.MiddleCenter); } this.InitializeLocator(this.PointWalker); this.InitializeLocator(this.AlignmentPointLocator); this.spriteLocator = new AlignedSpriteLocator(this.PointWalker, this.AlignmentPointLocator); this.spriteLocator.Sprite = this.Sprite; }
public override void Start() { base.Start(); if (this.AlignmentPointLocator == null) { this.AlignmentPointLocator = Locators.SpriteBoundsPoint(Corner.MiddleCenter); } this.InitializeLocator(this.RectangleLocator); this.InitializeLocator(this.AlignmentPointLocator); this.InitializeLocator(this.StartPointLocator); IPointLocator startLocator = this.StartPointLocator ?? Locators.At(this.RectangleLocator.GetRectangle().Location); this.walker = new RectangleWalker(this.RectangleLocator, this.WalkDirection, startLocator); this.walker.Sprite = this.Sprite; this.spriteLocator = new AlignedSpriteLocator(this.walker, this.AlignmentPointLocator); this.spriteLocator.Sprite = this.Sprite; }