Exemple #1
0
 public void Load(string fileName)
 {
     ImagePtr = SdlImage.IMG_Load(fileName);
     if (ImagePtr == IntPtr.Zero)
     {
         Hardware.FatalError("Image not found: " + fileName);
     }
 }
Exemple #2
0
 public void Load(string fileName)
 {
     internalPointer = SdlImage.IMG_Load(fileName);
     if (internalPointer == IntPtr.Zero)
     {
         SdlHardware.FatalError("Image not found: " + fileName);
     }
 }
Exemple #3
0
 public Menu()
 {
     ancho  = 800;
     alto   = 600;
     imagen = SdlImage.IMG_Load("img/BG.png");
     x      = 0;
     y      = 0;
 }
Exemple #4
0
 public Fondo()
 {
     ancho  = 2000;
     alto   = 600;
     imagen = SdlImage.IMG_Load("img/BG.png");
     x      = -600;
     y      = 0;
 }
        public void load(ResourceComponent rc, string path)
        {
            IntPtr surf = SdlImage.IMG_Load(path);

            if (surf == IntPtr.Zero)
            {
                throw new Exception("Error: failed to load resource at " + path + ": " + Sdl.SDL_GetError());
            }

            initFromSurface(surf);
        }
        public Texture2D(string path)
        {
            IntPtr surf = SdlImage.IMG_Load(path);

            if (surf == IntPtr.Zero)
            {
                throw new Exception("Error: failed to load resource: " + Sdl.SDL_GetError());
            }

            initFromSurface(surf);
        }
Exemple #7
0
    public Image(string fileName, short width, short height)
    {
        internalPointer = SdlImage.IMG_Load(fileName);
        if (internalPointer == IntPtr.Zero)
        {
            Console.WriteLine("Image not found");
        }

        this.width  = width;
        this.height = height;
    }
Exemple #8
0
    /// Carga una imagen (o sale con codigo de error si no existe)
    public static IntPtr CargarImagen(string fichero)
    {
        IntPtr imagen;

        imagen = SdlImage.IMG_Load(fichero);
        if (imagen == IntPtr.Zero)
        {
            ErrorFatal("Imagen inexistente: " + fichero);
        }
        return(imagen);
    }
Exemple #9
0
 public Bloque()
 {
     seccion[0] = SdlImage.IMG_Load("img/Bloque1.png");
     seccion[1] = SdlImage.IMG_Load("img/Bloque2.png");
     seccion[2] = SdlImage.IMG_Load("img/Bloque3.png");
     seccion[3] = SdlImage.IMG_Load("img/Bloque4.png");
     suelo      = true;
     ancho      = 128;
     alto       = 128;
     y          = 470;
 }
Exemple #10
0
 public Image(string fileName, short width, short height)
 {
     ImagePtr = SdlImage.IMG_Load(fileName);
     if (ImagePtr == IntPtr.Zero)
     {
         Console.WriteLine("Image not found");
         Environment.Exit(1);
     }
     ImageWidth  = width;
     ImageHeight = height;
 }
Exemple #11
0
 public Sprite(string nombreFichero, short ancho, short alto)
 {
     imagen = SdlImage.IMG_Load(nombreFichero);
     if (imagen == IntPtr.Zero)
     {
         System.Console.WriteLine("Imagen inexistente");
         Environment.Exit(1);
     }
     this.ancho = ancho;
     this.alto  = alto;
 }
Exemple #12
0
    public static IntPtr CargarImagen(string fichero)
    {
        IntPtr imagen;

        imagen = SdlImage.IMG_Load(fichero);
        if (imagen == IntPtr.Zero)
        {
            System.Console.WriteLine("Imagen inexistente: {0}", fichero);
            Environment.Exit(4);
        }
        return(imagen);
    }
Exemple #13
0
        public void Load()
        {
            string file       = "test.bmp";
            IntPtr surfacePtr = VideoSetup();
            IntPtr imagePtr   = SdlImage.IMG_Load(file);

            Assert.IsFalse(imagePtr == IntPtr.Zero);
            Sdl.SDL_Rect rect1  = new Sdl.SDL_Rect(0, 0, 200, 200);
            Sdl.SDL_Rect rect2  = new Sdl.SDL_Rect(0, 0, 200, 200);
            int          result = Sdl.SDL_BlitSurface(imagePtr, ref rect1, surfacePtr, ref rect2);

            Sdl.SDL_UpdateRect(surfacePtr, 0, 0, 200, 200);
            Thread.Sleep(sleepTime);
            Assert.AreEqual(result, 0);
            this.Quit();
        }
Exemple #14
0
        public Personaje()
        {
            ancho = 43;
            alto  = 67;

            x = 100;
            y = 406;

            saltar   = false;
            subiendo = false;

            for (int i = 1; i < 11; i++)
            {
                correr[i - 1] = SdlImage.IMG_Load("img/Walk-" + i + ".png");
            }

            imagen = correr[contador];
            contador++;
        }
Exemple #15
0
 public Bonus()
 {
     //Carga de las distintas imágenes de las recompensas
     imgPremio[0] = SdlImage.IMG_Load("img/Jelly1.png");
     imgPremio[1] = SdlImage.IMG_Load("img/Jelly2.png");
     imgPremio[2] = SdlImage.IMG_Load("img/Jelly3.png");
     imgPremio[3] = SdlImage.IMG_Load("img/Jelly4.png");
     imgPremio[4] = SdlImage.IMG_Load("img/Jelly5.png");
     imgPremio[5] = SdlImage.IMG_Load("img/Jelly6.png");
     imgPremio[6] = SdlImage.IMG_Load("img/Bloque4.png");
     imagen       = imgPremio[1];
     ancho        = 35;
     alto         = 35;
     x            = pos;
     //De esta forma evitamos que siempre salgan a la misma altura
     y = Convert.ToInt16(random.Next(280, 380));
     //Así evitamos que se solapen los objetos bonús
     pos += Convert.ToInt16(random.Next(800, 2000));
 }