Exemple #1
0
 /// <summary>
 /// Create a PointLocator that will align the given corner of a sprite
 /// at the given corner of the animation.
 /// </summary>
 /// <remarks>For example,
 /// Locators.SpriteAligned(Corners.MiddleCenter, Corner.BottomRight) means the center
 /// of the sprite will be placed at the bottom right corner of the animation.
 /// </remarks>
 /// <param name="spriteCorner">The corner of the sprite to be aligned</param>
 /// <param name="corner">The corner at which it will be aligned</param>
 /// <returns>A point locator</returns>
 public static IPointLocator SpriteAligned(Corner spriteCorner, Corner animationCorner)
 {
     return(Locators.SpriteAligned(spriteCorner, animationCorner, Point.Empty));
 }
Exemple #2
0
 /// <summary>
 /// Create a PointLocator that will align the given corner of a sprite
 /// at the corresponding corner of the animation.
 /// </summary>
 /// <remarks>For example,
 /// Locators.SpriteAligned(Corners.BottomRight) means the bottom right corner
 /// of the sprite will be placed at the bottom right corner of the animation.
 /// </remarks>
 /// <param name="corner">The corner to be aligned AND the corner at which it will be aligned</param>
 /// <returns>A point locator</returns>
 public static IPointLocator SpriteAligned(Corner corner)
 {
     return(Locators.SpriteAligned(corner, corner, Point.Empty));
 }
Exemple #3
0
 /// <summary>
 /// The same as SpriteAligned(Corner) but offset by a constant amount.
 /// </summary>
 /// <param name="corner"></param>
 /// <param name="offset"></param>
 /// <returns></returns>
 public static IPointLocator SpriteAligned(Corner corner, Point offset)
 {
     return(Locators.SpriteAligned(corner, corner, offset));
 }
Exemple #4
0
 /// <summary>
 /// Create a Mover that will move a sprite so that the given corner moves from the given
 /// proportional location of the animation bounds to the other given proportional location.
 /// </summary>
 public static MoveEffect Move(Corner spriteCorner, float fromProportionX, float fromProportionY, float toProportionX, float toProportionY)
 {
     return(new MoveEffect(
                Locators.SpriteAligned(spriteCorner, fromProportionX, fromProportionY),
                Locators.SpriteAligned(spriteCorner, toProportionX, toProportionY)));
 }
Exemple #5
0
 /// <summary>
 /// Create a PointLocator that will align the given corner of a sprite
 /// at the proportional location of bounds of the animation.
 /// </summary>
 /// <remarks>For example,
 /// Locators.SpriteAligned(Corners.MiddleCenter, 0.6f, 0.7f) means the center
 /// of the sprite will be placed 60% across and 70% down the animation.
 /// </remarks>
 /// <param name="spriteCorner">The corner of the sprite to be aligned</param>
 /// <param name="proportionX">The x axis proportion</param>
 /// <param name="proportionY">The y axis proportion</param>
 /// <returns>A point locator</returns>
 public static IPointLocator SpriteAligned(Corner spriteCorner, float proportionX, float proportionY)
 {
     return(Locators.SpriteAligned(spriteCorner, proportionX, proportionY, Point.Empty));
 }
Exemple #6
0
 public static MoveEffect Move(Corner fromCorner, Point fromOffset, Corner toCorner, Point toOffset)
 {
     return(new MoveEffect(
                Locators.SpriteAligned(fromCorner, fromOffset),
                Locators.SpriteAligned(toCorner, toOffset)));
 }
Exemple #7
0
 public static MoveEffect Move(Corner fromCorner, Corner toCorner)
 {
     return(new MoveEffect(
                Locators.SpriteAligned(fromCorner),
                Locators.SpriteAligned(toCorner)));
 }
Exemple #8
0
 /// <summary>
 /// Creates an animation that keeps the given corner in the centre of the animation
 /// </summary>
 /// <param name="cornerToCenter"></param>
 /// <returns></returns>
 public static MoveEffect Centre(Corner cornerToCenter)
 {
     return(new GotoEffect(Locators.SpriteAligned(Corner.MiddleCenter, cornerToCenter)));
 }
Exemple #9
0
 public static GotoEffect Goto(Corner toCorner, Point toOffset)
 {
     return(new GotoEffect(Locators.SpriteAligned(toCorner, toOffset)));
 }
Exemple #10
0
 public static GotoEffect Goto(Corner toCorner)
 {
     return(new GotoEffect(Locators.SpriteAligned(toCorner)));
 }