package world;
import java.awt.Font;

import org.newdawn.slick.Color;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.Image;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.TrueTypeFont;


public class Bouton
{
	Image background;
	public TrueTypeFont font;
	String texte;
	int x,y, width, height;
	public Bouton(String texte,int x, int y) throws SlickException
	{
		this.x = x;
		this.y = y;
		this.texte = texte;
		background = new Image("res/Monde/grandbouton.png");
		font = new TrueTypeFont(new Font("Arial", 0, 45), true);
		
		width = background.getWidth();
		height = background.getHeight();
	
	}
	public void draw(Graphics g)
	{
		g.drawImage(background, x, y);
		font.drawString(x+(width-font.getWidth(texte))/2, y+(height-font.getHeight(texte))/2, texte, new Color(30, 30, 30));
	}
	public boolean mouseOn(int x, int y)
	{
		return (x > this.x && x < this.x + width && y > this.y && y < this.y + height);
	}
}
