Guest User

Untitled

a guest
Jul 23rd, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. void draw() {
  2. /* ... */
  3. drawGui();
  4. surface.setTitle(String.format("%.2f", frameRate));
  5. }
  6.  
  7. // Call at end of draw call so it stays on top of all else.
  8. void drawGui() {
  9. resetMatrix();
  10. pushStyle();
  11. textSize(20.0);
  12. fill(255.0);
  13. // Double escape percent-sign so it isn't misinterpreted.
  14. text(String.format("HP: %.0f%%", 100 * 432/float(999)), 25.0, 25.0);
  15. popStyle();
  16. }
Add Comment
Please, Sign In to add comment