Package games.stendhal.client.gui.j2d
Class TextBoxFactory
java.lang.Object
games.stendhal.client.gui.j2d.TextBoxFactory
A helper class for painting speech bubbles and other
messages used on the screen.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateFancyTextBox(String text, Color textColor, int width, int leftMargin, int rightMargin, int topMargin, int bottomMargin, BackgroundPainter background) Create a text box with an image background.createTextBox(String text, int width, Color textColor, Color fillColor, boolean isTalking) Creates a text box sprite.
-
Constructor Details
-
TextBoxFactory
public TextBoxFactory()Create a new TextBoxFactory.
-
-
Method Details
-
createTextBox
public Sprite createTextBox(String text, int width, Color textColor, Color fillColor, boolean isTalking) Creates a text box sprite.- Parameters:
text- the text inside the boxwidth- maximum width of the text in the box in pixelstextColor- color of the textfillColor- background colorisTalking- true if the box should look like a chat bubble- Returns:
- sprite of the text box
-
createFancyTextBox
public Sprite createFancyTextBox(String text, Color textColor, int width, int leftMargin, int rightMargin, int topMargin, int bottomMargin, BackgroundPainter background) Create a text box with an image background.- Parameters:
text- the text inside the boxtextColor- base color of the textwidth- maximum width of the text in the box in pixelsleftMargin- margin from the left side of the background image to the drawn textrightMargin- margin from the right side of the background image to the drawn texttopMargin- margin from the top of the background image to the drawn textbottomMargin- margin from the bottom of the background image to the drawn textbackground- painter for the background- Returns:
- text box sprite
-