Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.clepto.zombiez2d.gfx;
- public class Font {
- private String chars = "" + //
- "ABCDEFGHIJKLMNOPQRSTUVWXYZ " + //
- "0123456789.,!?'\"-=/\\%()<> " + //
- "";
- public void draw(String msg, Screen screen, int x, int y) {
- msg = msg.toUpperCase();
- for (int i = 0; i < msg.length(); i++) {
- int ix = chars.indexOf(msg.charAt(i));
- if (ix >= 0) {
- screen.setTile(x + i, y, ix + 30 * 32, (5 + 5 * 6 + 5 * 36) * 256 * 256 * 256, 0);
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment