Ejemplo n.º 1
0
        /// <summary>
        /// Inicializa el contenedor de imágenes.
        /// </summary>
        /// <param name="game"></param>
        internal new static void Initialize(Game game)
        {
            _fuentesR = new FuentesSpriteR(game);
            _fuentesR._diccionarioFuentes = new Dictionary <string, SpriteFont>();

            game.Components.Add(_fuentesR);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Inicializa todas las clases hijas de los recursos.
 /// </summary>
 /// <param name="game"></param>
 public static void Initialize(Game game)
 {
     EfectosSonidoR.Initialize(game);
     CancionesR.Initialize(game);
     ImagenesR.Initialize(game);
     FuentesSpriteR.Initialize(game);
 }
Ejemplo n.º 3
0
        public void CargarDatos()
        {
            var datos = _documento.Document.Descendants(_nombreSep);

            foreach (var datosDados in datos)
            {
                try
                {
                    string nombre   = datosDados.Attribute(_Alias).Value;
                    string datoRuta = datosDados.Attribute(_Ruta).Value;
                    if (!string.IsNullOrEmpty(nombre) && !string.IsNullOrEmpty(datoRuta))
                    {
                        string tipoDato = datosDados.Attribute(_TipoDato).Value.ToLower();
                        switch (tipoDato)
                        {
                        case "cancion":
                            CancionesR.CargarCancion(datoRuta, nombre);
                            break;

                        case "fuente":
                            FuentesSpriteR.CargarFuente(datoRuta, nombre);
                            break;

                        case "imagen":
                            ImagenesR.CargarImagen(datoRuta, nombre);
                            break;

                        case "efecto sonido":
                            goto case "efectosonido";

                        case "efectosonido":
                            EfectosSonidoR.CargarEfectoSonido(datoRuta, nombre);
                            break;

                        default:
                            System.Diagnostics.Debug.WriteLine("El tipo de dato no existe: " + tipoDato);
                            break;
                        }  //switch
                    }   //if
                    else
                    {
                        System.Diagnostics.Debug.WriteLine("El nombre o ruta del XML de datos no puede ser nula o vacía");
                    }
                }
                catch (NullReferenceException ex)
                {
                    System.Diagnostics.Debug.WriteLine("Valor nulo en la animación : " + datosDados.Attribute(_Alias).Value + "no existe");
                    throw (ex);
                }
                catch (FormatException ex)
                {
                    System.Diagnostics.Debug.WriteLine("Los valores deben ser enteros para la longitud,anchura, filas y columnas");
                    throw (ex);
                }
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Inicializa el contenedor de imágenes.
        /// </summary>
        /// <param name="game"></param>
        internal static new void Initialize(Game game)
        {
            _fuentesR = new FuentesSpriteR(game);
            _fuentesR._diccionarioFuentes = new Dictionary<string, SpriteFont>();

            game.Components.Add(_fuentesR);
        }