public static List <Composite.Frame> CreateFrames(List <SpriteSheet> layers, List <Color> tints, params int[][] frames)
        {
            List <Composite.Frame> frameList = new List <Composite.Frame>();

            foreach (int[] frame in frames)
            {
                Composite.Frame currFrame = new Composite.Frame();

                int x = frame[0];
                int y = frame[1];

                currFrame.Position = new Point(x, y);

                for (int j = 2; j < frame.Length; j++)
                {
                    int layer = frame[j];
                    currFrame.Layers.Add(layers[layer]);
                    currFrame.Tints.Add(tints[Math.Min(Math.Max(layer, 0), tints.Count - 1)]);
                }

                frameList.Add(currFrame);
            }

            return(frameList);
        }
Example #2
0
        public static List<Composite.Frame> CreateFrames(List<SpriteSheet> layers, List<Color> tints, params int[][] frames)
        {
            List<Composite.Frame> frameList = new List<Composite.Frame>();
            foreach (int[] frame in frames)
            {
                Composite.Frame currFrame = new Composite.Frame();

                int x = frame[0];
                int y = frame[1];

                currFrame.Position = new Point(x, y);

                for (int j = 2; j < frame.Length; j++)
                {
                    int layer = frame[j];
                    currFrame.Layers.Add(layers[layer]);
                    currFrame.Tints.Add(tints[Math.Min(Math.Max(layer, 0), tints.Count - 1)]);
                }

                frameList.Add(currFrame);
            }

            return frameList;
        }