Eliminated unneeded calls to Graphics.setColor().
The method creates a new Color object each call, so set color in UnicodeFont.drawString() instead. Also slightly padded the song information text. Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
@@ -88,23 +88,23 @@ public class MainMenuExit extends BasicGameState {
|
||||
public void render(GameContainer container, StateBasedGame game, Graphics g)
|
||||
throws SlickException {
|
||||
g.setBackground(Color.black);
|
||||
g.setColor(Color.white);
|
||||
|
||||
// draw text
|
||||
float c = container.getWidth() * 0.02f;
|
||||
Utils.FONT_LARGE.drawString(c, c, "Are you sure you want to exit opsu!?");
|
||||
Utils.FONT_LARGE.drawString(c, c, "Are you sure you want to exit opsu!?", Color.white);
|
||||
|
||||
// draw buttons
|
||||
yesButton.draw(Color.green);
|
||||
noButton.draw(Color.red);
|
||||
g.setFont(Utils.FONT_XLARGE);
|
||||
g.drawString("1. Yes",
|
||||
Utils.FONT_XLARGE.drawString(
|
||||
yesButton.getX() - (Utils.FONT_XLARGE.getWidth("1. Yes") / 2f),
|
||||
yesButton.getY() - (Utils.FONT_XLARGE.getLineHeight() / 2f)
|
||||
yesButton.getY() - (Utils.FONT_XLARGE.getLineHeight() / 2f),
|
||||
"1. Yes", Color.white
|
||||
);
|
||||
g.drawString("2. No",
|
||||
Utils.FONT_XLARGE.drawString(
|
||||
noButton.getX() - (Utils.FONT_XLARGE.getWidth("2. No") / 2f),
|
||||
noButton.getY() - (Utils.FONT_XLARGE.getLineHeight() / 2f)
|
||||
noButton.getY() - (Utils.FONT_XLARGE.getLineHeight() / 2f),
|
||||
"2. No", Color.white
|
||||
);
|
||||
|
||||
Utils.drawFPS();
|
||||
|
||||
Reference in New Issue
Block a user