Ejemplo n.º 1
0
 public void AddElementoAnimado(string img, int prof, float _w, float _h, float i, float j, bool s, Rectangle r, Animacion _Ani)
 {
     Elemento_Ani temp = new Elemento_Ani((int)(x + j * k), (int)(y + i * k), _w, _h, k, prof, s);
     temp.AddImg(img);
     temp.DefinePortion(r.X, r.Y, r.Width, r.Height);
     temp.AddAnimation(_Ani, F_H);
     Ele.Add(temp);
 }
Ejemplo n.º 2
0
 public void CargarElementoAnimado(XmlNodeList _Dinamicos,ref Map _mapa)
 {
     XmlNodeList _Elemento = ((XmlElement)_Dinamicos[0]).GetElementsByTagName("Elemento_Animado");
     //------------------Cargar info del Elemento animado--------------------//
     foreach (XmlElement a in _Elemento)
     {       //---------------------------Cargando datos del elemento-----------------//
         bool solid = bool.Parse(a.GetAttribute("solido"));
         float width = float.Parse(a.GetAttribute("width"));
         float height = float.Parse(a.GetAttribute("height"));
         Elemento_Ani temp = new Elemento_Ani(0, 0, width, height, 1, 0, solid);
         //-----------------------Cargando datos de la imagen----------------//
         temp=(Elemento_Ani)CargarImagen(temp, a);
         //----------------------Cargando datos de animaciones----------------//
         temp.ani = CargarAnimacion(a,temp.im)[0];
         //----------------------Cargar posiciones--------------------------//
         List<PointF> posiciones=CargarPosicion(a);
         foreach (PointF punto in posiciones)
         {
             Elemento_Ani _E = new Elemento_Ani(punto.X, punto.Y, temp.rec[0].Width, temp.rec[0].Height, _mapa.k, temp.profundidad, temp.solido);
             _E.AddImg(temp.im);
             _E.DefinePortion(temp.rec[1].X, temp.rec[1].Y, temp.rec[1].Width, temp.rec[1].Height);
             _E.AddAnimation(temp.ani,new FileHandler(GetImg));
             _E.type = "Animado";
             _mapa.AddElemento(_E, punto.X, punto.Y);
         }
     }
 }