Java Code Examples for com.watabou.utils.PointF#set()

The following examples show how to use com.watabou.utils.PointF#set() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BitmapTextMultiline.java    From remixed-dungeon with GNU General Public License v3.0 6 votes vote down vote up
private void getWordMetrics( String word, PointF metrics ) {
	
	float w = 0;
	float h = 0;
	
	int length = word.length();
	for (int i=0; i < length; i++) {
		
		RectF rect = font.get( word.charAt( i ) );
		//Corrigido
		if (rect == null) {
			rect = font.get(INVALID_CHAR);
		}
		w += font.width( rect ) + (w > 0 ? font.tracking : 0);
		
		h = Math.max( h, font.height( rect ) + glyphShiftY(word.charAt( i )));
	}
	
	metrics.set( w, h );
}
 
Example 2
Source File: BitmapTextMultiline.java    From YetAnotherPixelDungeon with GNU General Public License v3.0 5 votes vote down vote up
private void getWordMetrics( String word, PointF metrics ) {
	
	float w = 0;
	float h = 0;
	
	int length = word.length();
	for (int i=0; i < length; i++) {
		
		RectF rect = font.get( word.charAt( i ) );
		w += font.width( rect ) + (w > 0 ? font.tracking : 0);
		h = Math.max( h, font.height( rect ) );
	}
	
	metrics.set( w, h );
}
 
Example 3
Source File: BitmapTextMultiline.java    From PD-classes with GNU General Public License v3.0 5 votes vote down vote up
private void getWordMetrics( String word, PointF metrics ) {
	
	float w = 0;
	float h = 0;
	
	int length = word.length();
	for (int i=0; i < length; i++) {
		
		RectF rect = font.get( word.charAt( i ) );
		w += font.width( rect ) + (w > 0 ? font.tracking : 0);
		h = Math.max( h, font.height( rect ) );
	}
	
	metrics.set( w, h );
}