Guest User

Untitled

a guest
Jun 23rd, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.48 KB | None | 0 0
  1. package com.clepto.zombiez2d.gfx;
  2.  
  3. public class Font {
  4.     private String chars = "" + //
  5.             "ABCDEFGHIJKLMNOPQRSTUVWXYZ      " + //
  6.             "0123456789.,!?'\"-=/\\%()<>      " + //
  7.             "";
  8.  
  9.     public void draw(String msg, Screen screen, int x, int y) {
  10.         msg = msg.toUpperCase();
  11.         for (int i = 0; i < msg.length(); i++) {
  12.             int ix = chars.indexOf(msg.charAt(i));
  13.             if (ix >= 0) {
  14.                 screen.setTile(x + i, y, ix + 30 * 32, (5 + 5 * 6 + 5 * 36) * 256 * 256 * 256, 0);
  15.             }
  16.         }
  17.     }
  18. }
Add Comment
Please, Sign In to add comment