sdl.ext.sfont
Class SFont
java.lang.Object
|
+--sdl.ext.sfont.SFont
- public class SFont
- extends java.lang.Object
Wrapper for SFont library. Sfont is a simple Font library that
uses small bitmapped (non-scalable) fonts. The SFont homepage is located
at http://www.linux-games.com/sfont/
Basic use is as follows
SDLSurface fontSurface = null;
SDLSurface screen = initSDL();
fontSurface = SDLImage.createFromFile(name);
SFont font = new SFont(fontSurface);
font.putString(screen,0,0,"Top Left");
font.putString(screen, 60, 120, "SFont by Karl Bartel is GPL'ed!");
font.putString(screen, 300, 260, "@--~!%&'_*,.:;");
font.putString(screen, 640-font.getTextWidth("Bottom Right!"),480-font.getHeight(),"Bottom Right!");
screen.updateRect(0,0,0,0);
String data = "Enter Data";
String result = font.getInputString(screen, 260, 350, 280, data);
- See Also:
SDLSurface
,
SDLImage
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
m_InputString
public java.lang.String m_InputString
SFont
public SFont(SDLSurface s)
getHeight
public int getHeight()
putString
public void putString(SDLSurface screen,
int x,
int y,
java.lang.String s)
getTextWidth
public int getTextWidth(java.lang.String s)
xCenteredString
public void xCenteredString(int y,
java.lang.String s)
getInputString
public java.lang.String getInputString(SDLSurface screen,
int x,
int y,
int width,
java.lang.String s)