de.lessvoid.nifty.elements.tools
Class FontHelper
java.lang.Object
de.lessvoid.nifty.elements.tools.FontHelper
public class FontHelper
- extends Object
Method Summary |
static int |
getCharacterIndexFromPixelPosition(RenderFont font,
String text,
int pixel,
float size)
get index into text from a given pixel position. |
static char |
getNextCharacter(String text,
int i)
|
static char |
getPrevCharacter(String text,
int i)
|
static int |
getVisibleCharactersFromEnd(RenderFont font,
String text,
int width,
float size)
Get character index into the given text that is no more pixel as the given width. |
static int |
getVisibleCharactersFromStart(RenderFont font,
String text,
int width,
float size)
Get character index into the given text that is no more pixel as the given width. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FontHelper
public FontHelper()
getVisibleCharactersFromStart
public static int getVisibleCharactersFromStart(RenderFont font,
String text,
int width,
float size)
- Get character index into the given text that is no more pixel as the given width.
- Parameters:
font
- fonttext
- the string to checkwidth
- the minimum width
- Returns:
- the character index into the string.
getVisibleCharactersFromEnd
public static int getVisibleCharactersFromEnd(RenderFont font,
String text,
int width,
float size)
- Get character index into the given text that is no more pixel as the given width.
- Parameters:
font
- fonttext
- the string to checkwidth
- the minimum width
- Returns:
- the character index into the string.
getCharacterIndexFromPixelPosition
public static int getCharacterIndexFromPixelPosition(RenderFont font,
String text,
int pixel,
float size)
- get index into text from a given pixel position.
- Parameters:
font
- fonttext
- text stringpixel
- pixel indexsize
- font size
- Returns:
- index into text string
getNextCharacter
public static char getNextCharacter(String text,
int i)
- Parameters:
text
- i
-
- Returns:
getPrevCharacter
public static char getPrevCharacter(String text,
int i)
- Parameters:
text
- i
-
- Returns:
Copyright © 2011. All Rights Reserved.