Example #1
0
 public OffsetForm(Animation animation)
 {
     InitializeComponent();
     RectangleOffset += new RectangleTransformedEventHandler(OffsetForm_RectangleOffset);
     currentAnimation = animation;
     InitalizeComboBox();
     numericUpDownOffset.Maximum = currentAnimation.Frames.Length;
 }
Example #2
0
 public AnimationManager(IServiceProvider serviceProvider)
 {
     content = new ContentManager(serviceProvider, "Data");
     animations = new Animation[Enum.GetValues(typeof(Anims)).Length];
     //textures = new Dictionary<string, Texture2D>();
     for (int i = 0; i < animations.Length; i++)
     {
         animations[i] = new Animation();
     }
 }
Example #3
0
        public ParentForm(Animation animation)
        {
            InitializeComponent();
            foreach (string value in animation.CurrentFrame.GetRectangles.Keys)
            {
                comboBox1.Items.Add(value);
                comboBox2.Items.Add(value);
            }
            currentAnimation = animation;

            ChildTransformed += new RectangleTransformedEventHandler(ParentForm_ChildTransformed);
        }
Example #4
0
 public void Initialize()
 {
     foreach (Anims anim in Enum.GetValues(typeof(Anims)))
         animations[(int)anim] = new Animation();
 }
Example #5
0
        public void Initialize(Dictionary<Anims,string> anims,Dictionary<Star.Game.Enemy.Enemy.EnemyVariables,string> dict,string name)
        {
            string path = GameConstants.EnemiesPath + name + "/" ;
            string[] rectangles;
            rectangles = dict[Enemy.EnemyVariables.AnimRectangles].Split(',');

            for (int i = 0; i < rectangles.Length;i++)
            {
                rectangles[i] = rectangles[i].Trim();
            }
            //textures = new Dictionary<string, Texture2D>();
            //foreach (string rect in rectangles)
            //{
            //    try
            //    {
            //        textures.Add(rect, content.Load<Texture2D>(path + rect));
            //    }
            //    catch
            //    {
            //        textures.Add(rect, content.Load<Texture2D>("Stuff/Error"));
            //    }
            //}

            animations = new Animation[Enum.GetValues(typeof(Anims)).Length];
            foreach (Anims anim in anims.Keys.ToArray())
            {
                animations[(int)anim] = new Animation();
                animations[(int)anim].LoadAnimation(anims[anim], rectangles);
            }
        }