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