daily pastebin goal
88%
SHARE
TWEET

Stupid Flickering

RandomGuy32 Jun 27th, 2016 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class NativeScreenText {
  2.     public static void draw(String text, Color color, int x, int y) {
  3.         Graphics g = Screen.mainCanvas.getGraphics();
  4.  
  5.         Screen.mainCanvas.setDoubleBuffered(true);
  6.         g.setColor(color);
  7.         Screen.mainCanvas.setDoubleBuffered(true);
  8.         g.drawString(text, x, y);
  9.     }
  10.     public static void draw(String text, Color color, Color shadow, int x, int y, int shadowOffsetX, int shadowOffsetY) {
  11.         Screen.mainCanvas.setDoubleBuffered(true);
  12.         NativeScreenText.draw(text, shadow, x + shadowOffsetX, y + shadowOffsetY);
  13.         Screen.mainCanvas.setDoubleBuffered(true);
  14.         NativeScreenText.draw(text, color, x, y);
  15.     }
  16. }
  17.  
  18.  
  19.  
  20.  
  21.  
  22. public void renderHUD(Graphics g) {
  23.         this.setDoubleBuffered(true);
  24.         for (int i = 0; i < MenuManager.fields.size(); i++) {
  25.             MenuManager.fields.get(i).render(g);
  26.         }
  27.  
  28.         // Misc
  29.         this.setDoubleBuffered(true);
  30.         NativeScreenText.draw(Long.toString(Game.runTime), Color.WHITE, Color.BLACK, 100, 17, 1, 1);
  31.     }
RAW Paste Data
Top