I tried doing this to change the font size of my intro, but I am getting an error of "the method setFont() in the type Graphics is not applicable for the arguments (Font) "
Here is what I’ve tried:
import java.awt.Font;
import org.lwjgl.input.Mouse;
import org.newdawn.slick.*;
import org.newdawn.slick.state.*;
public class FirstGameMenu extends BasicGameState{
Font font;
public FirstGameMenu(int state){
}
// load all fonts, graphics, sounds, etc
public void init(GameContainer gc, StateBasedGame sbg) throws SlickException{
font = new Font("Time New Roman", Font.BOLD, 20);
}
//draw stuff on the screen
public void render(GameContainer gc, StateBasedGame sbg, Graphics g) throws SlickException{
Image enter = new Image("res1/button2.png");
//set the coordinates for the pic
g.drawImage(enter, 315, 180);
g.setFont(font);
g.drawString("How to Play", 385, 460);
g.drawString("Exit", 415, 520);
}