/**
 * Copyright (C) 2013 MK124
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

package net.gtaun.wl.common.textdraw;

import net.gtaun.shoebill.SampObjectFactory;
import net.gtaun.shoebill.object.Player;
import net.gtaun.shoebill.object.PlayerTextdraw;

public final class TextDrawUtils
{
	public static PlayerTextdraw createPlayerText(SampObjectFactory f, Player player, float x, float y, String text)
	{
		PlayerTextdraw textdraw = f.createPlayerTextdraw(player, x, (y-50)/1.075f+50, text);
		return textdraw;
	}
	
//	public static PlayerTextdraw createPlayerTextBG(SampObjectFactory f, Player player, float x, float y, float w, float h)
//	{
//		int lines = Math.round((h - 5) / 5.0f);
//		PlayerTextdraw textdraw = f.createPlayerTextdraw(player, x+4, (y-50)/1.075f+50, StringUtils.repeat("~n~", lines));
//		textdraw.setUseBox(true);
//		textdraw.setLetterSize(1.0f, 0.5f);
//		textdraw.setTextSize(x+w-4, h-7);
//		return textdraw;
//	}
	
	
	private TextDrawUtils()
	{
		
	}
}

@@ -508,16 +508,62 @@
 tdraw;%0A%0A
+import org.apache.commons.lang3.StringUtils;%0A%0A
 import n
@@ -599,16 +599,16 @@
 actory;%0A
-
 import n
@@ -953,18 +953,16 @@
 w;%0A%09%7D%0A%09%0A
-//
 %09public 
@@ -1078,15 +1078,11 @@
  h)%0A
-//
 %09%7B%0A
-//
 %09%09in
@@ -1119,18 +1119,16 @@
  5.0f);%0A
-//
 %09%09Player
@@ -1236,18 +1236,16 @@
 ines));%0A
-//
 %09%09textdr
@@ -1264,18 +1264,16 @@
 (true);%0A
-//
 %09%09textdr
@@ -1302,18 +1302,16 @@
  0.5f);%0A
-//
 %09%09textdr
@@ -1338,18 +1338,16 @@
 , h-7);%0A
-//
 %09%09return
@@ -1361,10 +1361,8 @@
 aw;%0A
-//
 %09%7D%0A%09

解除封印（无误