/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ManicMiner;

import java.io.*;
import javax.microedition.lcdui.*;

/**
 *
 * @author supervisor
 */
public class Creditos {

    Image[] fondos;
    
    String textos[] = {"CREDITS OF MANIC MINER: ",
        
                       "   CREATOR OF ORIGINAL GAME \n"+
                       "       Matthew Smith\n" ,
                       
                       "   CREATOR OF REMAKE\n   "+
                       "Jose Manuel García Maestre\n",

                       " MATTHEW SMITH'S GAMES \n"+
                       "   Manic Miner\n"+
                       "   Jet Set Willy \n",

                       "THANKS MY FAMYLY AND FRIENDS\n"+
                       "FOR SUPPORTING THE PROJECT\n",

                       "THANKS FOR PLAYING\n"
                           };

    int indice; //Selecciona desde el primer texto al ultimo

    int x1;
    int y1;

    int anchoPantalla;
    int altoPantalla;

    int ANCHURALETRA = 5;
    int ALTURALETRA = 6;
    Font fuente;

    public Creditos(int ancho, int alto){

        anchoPantalla = ancho;
        altoPantalla = alto;

        indice = 0;

        x1 = ancho/10;
        y1 = (alto-ALTURALETRA)/2; //6 es la altura de una letra
        fuente = Font.getFont(Font.FACE_PROPORTIONAL,Font.STYLE_BOLD,Font.SIZE_SMALL);
    }

    void dibujarCreditos(Graphics g){

        String cadena = textos[indice];

        g.setColor(0,0,0);
        g.fillRect(0, 0, anchoPantalla , altoPantalla);


        g.setColor(255,255,255);
        g.setFont(fuente);
        g.drawString(cadena, x1, y1, Graphics.LEFT |Graphics.BASELINE); //5 es la anchura de una letra

        indice++;

    }

    boolean fin()
    {
        return (indice == textos.length);
    }

}
