예제 #1
0
 public static void addFrameToAnimation(CubeAnimationData animation, string frameName, int frameTime)
 {
     int i = 0;
     CubeAnimationFrame[] newFrames = new CubeAnimationFrame[animation.Frames.Length + 1];
     for (i = 0; i < animation.Frames.Length; i++)
     {
         newFrames[i] = animation.Frames[i];
     }
     newFrames[i] = new CubeAnimationFrame(frameName, frameTime);
     animation.Frames = newFrames;
 }
예제 #2
0
        public static void duplicateFrameInAnimation(CubeAnimationData animation, int frameNumber, string frameName, int frameTime)
        {
            int i = 0;
            CubeAnimationFrame[] newFrames = new CubeAnimationFrame[animation.Frames.Length + 1];
            for (i = 0; i < animation.Frames.Length; i++)
            {
                newFrames[i] = animation.Frames[i];
            }
            newFrames[i] = new CubeAnimationFrame();
            newFrames[i].FrameData = (byte[])animation.Frames[frameNumber].FrameData.Clone();
            newFrames[i].FrameName = frameName.Clone().ToString();
            newFrames[i].FrameTime = frameTime;

            animation.Frames = newFrames;
        }
예제 #3
0
 public CubeAnimationData()
 {
     globalOptions = new CubeAnimationGlobalOptions("untitled", 50);
     frames = new CubeAnimationFrame[1];
     frames[0] = new CubeAnimationFrame("untitled frame", 50);
 }
예제 #4
0
 public static void removeFrameFromAnimation(CubeAnimationData animation, int frameNumber)
 {
     int i = 0;
     CubeAnimationFrame[] newFrames = new CubeAnimationFrame[animation.Frames.Length - 1];
     for (i = 0; i < animation.Frames.Length; i++)
     {
         if (i < frameNumber)
         {
             newFrames[i] = animation.Frames[i];
         }
         else if (i == frameNumber)
         {
             continue;
         }
         else
         {
             newFrames[i - 1] = animation.Frames[i];
         }
     }
     animation.Frames = newFrames;
 }