Example #1
0
        public static Animation GetAnimationFromUser()
        {
            pln(" -- New Animation --");
              string response;
              int numResponse;
              double dblResponse;
              Animation res = new Animation();

              pnn("Repeatable (yes/no): ");
              response = getLine();
              if (response == "no")
            res.Repeatable = false;

              do {
            pnn("Frame (-1 to end): ");
            Int32.TryParse(getLine(), out numResponse);
            if (numResponse >= 0) {
              pnn("Frame Length (in ms): ");
              Double.TryParse(getLine(), out dblResponse);
              res.AddFrame(numResponse, dblResponse);
            }
              } while (numResponse >= 0);

              if (res.Frames.Count > 0)
            return res;
              return null;
        }
Example #2
0
 public void AddAnimation(Animation newAnim)
 {
     Animations.Add(newAnim);
 }
Example #3
0
 public IDrawHelper GetAnimationHelper(Animation anim)
 {
     return new AnimationHelper(this, anim);
 }
Example #4
0
 public void AddAnimation(string key, Animation newAnim)
 {
     AnimationLookup.Add(key, Animations.Count);
       Animations.Add(newAnim);
 }
Example #5
0
 public AnimationHelper(TileSheet tileSheet, Animation animation, Point?pos = null, float scale = 1f, float depth = 1f)
     : base(tileSheet, pos, scale, depth)
 {
     Animation = animation;
 }
Example #6
0
 public override int GetFrame()
 {
     return(Animation.GetFrameFromTime(RunningTime));
 }
Example #7
0
        public AnimationState(TileSheet tileSheet, Animation animation,
			  Point? pos = null, float scale = 1f, float depth = 1f)
            : base(tileSheet, animation, pos, scale, depth)
        {
        }
Example #8
0
 public AnimationHelper(TileSheet tileSheet, Animation animation, Point? pos = null, float scale = 1f, float depth = 1f)
     : base(tileSheet, pos, scale, depth)
 {
     Animation = animation;
 }