Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void draw() {
- /* ... */
- drawGui();
- surface.setTitle(String.format("%.2f", frameRate));
- }
- // Call at end of draw call so it stays on top of all else.
- void drawGui() {
- resetMatrix();
- pushStyle();
- textSize(20.0);
- fill(255.0);
- // Double escape percent-sign so it isn't misinterpreted.
- text(String.format("HP: %.0f%%", 100 * 432/float(999)), 25.0, 25.0);
- popStyle();
- }
Add Comment
Please, Sign In to add comment