示例#1
0
        public UnmovingSprite(
            AnimationSurface animationSurface, Point2 location)
        {
            Contract.Requires(animationSurface != null);

            _animationSurface = animationSurface;
            _location = location;
        }
示例#2
0
 public UniformMotionSprite(
     AnimationSurface animationSurface, Point2 startLocation,
     Vector2 velocity, float totalTime)
     : this(animationSurface, startLocation,
         startLocation + (Vector2)(velocity * totalTime),
         totalTime)
 {
 }
示例#3
0
        public UniformMotionSprite(
            AnimationSurface animationSurface, Point2 startLocation,
            Point2 endLocation, float totalTime)
        {
            Contract.Requires(animationSurface != null);

            _animationSurface = animationSurface;
            StartLocation = startLocation;
            _location = startLocation;
            _diffVector = endLocation - startLocation;
            _totalTime = totalTime;
        }
示例#4
0
 public UniformMotionSprite(
     AnimationSurface animationSurface, Point2 startLocation,
     Point2 endLocation, float speedOrTotalTime, bool isSpeed)
     : this(animationSurface, startLocation, endLocation,
         isSpeed
             ? (float)(endLocation - startLocation).Length
               / speedOrTotalTime
             : speedOrTotalTime)
 {
 }