Not Showing A Letter When Using Java Font -
i fooling around in java,when decided make font class, , own fonts. prints right, when type "hello world" code, program shows "hello xorld!". tried switching x , w, shows "hello yorld", , on. fixes?
also, when try type in hello xorld, spits out "hello yorld".
public class font { private static string chars="abcdefghijklmnopqrsrtuvwxyz 0123456789.,:;'\"!?$%()-=+/ "; public static void render (string msg,screen screen,int x,int y,int colour){ msg= msg.touppercase(); (int i=0;i<msg.length();i++) { int charindex= chars.indexof(msg.charat(i)); if (charindex>=0)screen.render(x+(i*8), y, charindex+30*32, colour); } } }
in different class:
font.render("hello world 0157",screen,0,0,colours.get(000,-1,-1,555));
in char[] array, have this:
....abcdefghijklmnopqrsrtuvwxyz.... . ^
note r comes after s. change to:
abcdefghijklmnopqrstuvwxyz
otherwise every letter after s 1 out of position.
Comments
Post a Comment