package projectzombie.menu.gui.components;

import gl_engine.vec.Vec2d;
import projectzombie.menu.gui.GUIButton;

public class ButtonBasic extends GUIButton {
	
	private ButtonCallback callback;
	
	public ButtonBasic(String text, ButtonCallback callback) {
		setText(text);
		
		this.callback = callback;
	}
	
	public ButtonBasic(String text, Vec2d pos, ButtonCallback callback) {
		this(text, callback);
		
		setPos(pos);
	}
	
	@Override
	public void onMouseClick(Vec2d pos) {
		super.onMouseClick(pos);
		
		callback.onClick(this);
	}
}
