public class TextBox extends InterfaceObject implements org.newdawn.slick.MouseListener
Constructor and Description |
---|
TextBox(org.newdawn.slick.GameContainer gc)
Text box constructor
|
Modifier and Type | Method and Description |
---|---|
void |
add(TextBlock text)
Adds text to text box
|
void |
addAll(java.util.List<TextBlock> texts)
Adds all text blocks to text box
|
void |
clear()
Removes all text from box
|
boolean |
contains(java.lang.String rawText) |
void |
draw(float x,
float y,
float width,
float height,
boolean scaledPos)
Draws text box
|
void |
inputEnded() |
void |
inputStarted() |
boolean |
isAcceptingInput() |
void |
mouseClicked(int button,
int x,
int y,
int clickCount) |
void |
mouseDragged(int oldx,
int oldy,
int newx,
int newy) |
void |
mouseMoved(int oldx,
int oldy,
int newx,
int newy) |
void |
mousePressed(int button,
int x,
int y) |
void |
mouseReleased(int button,
int x,
int y) |
void |
mouseWheelMoved(int change) |
void |
setFocus(boolean focus)
Sets or removes focus on this box
|
void |
setInput(org.newdawn.slick.Input input) |
void |
useContainer(java.util.List<TextBlock> container)
Sets specified list with texts as box content
|
atCenter, draw, draw, draw, draw, draw, draw, draw, getDis, getPos, getScale, getScaledHeight, getScaledWidth, getSize, isMouseOver, setInfo, setPosition, setSize
bind, clampTexture, copy, destroy, draw, draw, draw, draw, draw, draw, drawCentered, drawEmbedded, drawEmbedded, drawEmbedded, drawFlash, drawFlash, drawFlash, drawSheared, drawSheared, drawWarped, endUse, ensureInverted, flushPixelData, getAlpha, getCenterOfRotationX, getCenterOfRotationY, getColor, getFilter, getFlippedCopy, getGraphics, getHeight, getName, getResourceReference, getRotation, getScaledCopy, getScaledCopy, getSubImage, getTexture, getTextureHeight, getTextureOffsetX, getTextureOffsetY, getTextureWidth, getWidth, isDestroyed, rotate, setAlpha, setCenterOfRotation, setColor, setColor, setFilter, setImageColor, setImageColor, setName, setRotation, setTexture, startUse, toString
public TextBox(org.newdawn.slick.GameContainer gc) throws org.newdawn.slick.SlickException, java.io.IOException, java.awt.FontFormatException
gc
- Slick game containerorg.newdawn.slick.SlickException
java.io.IOException
java.awt.FontFormatException
public void draw(float x, float y, float width, float height, boolean scaledPos)
draw
in class InterfaceObject
x
- Position on x axisy
- Position on y axiswidth
- Width for objectheight
- Height for objectscaledPos
- True if object position should be scaledpublic void add(TextBlock text)
text
- Block of textpublic void addAll(java.util.List<TextBlock> texts)
texts
- List with blocks of textpublic void clear()
public void useContainer(java.util.List<TextBlock> container)
container
- List with text blockspublic void setFocus(boolean focus)
focus
- True to set focus on box, false to remove focuspublic void inputEnded()
inputEnded
in interface org.newdawn.slick.ControlledInputReciever
public void inputStarted()
inputStarted
in interface org.newdawn.slick.ControlledInputReciever
public boolean isAcceptingInput()
isAcceptingInput
in interface org.newdawn.slick.ControlledInputReciever
public void setInput(org.newdawn.slick.Input input)
setInput
in interface org.newdawn.slick.ControlledInputReciever
public void mouseClicked(int button, int x, int y, int clickCount)
mouseClicked
in interface org.newdawn.slick.MouseListener
public void mouseDragged(int oldx, int oldy, int newx, int newy)
mouseDragged
in interface org.newdawn.slick.MouseListener
public void mouseMoved(int oldx, int oldy, int newx, int newy)
mouseMoved
in interface org.newdawn.slick.MouseListener
public void mousePressed(int button, int x, int y)
mousePressed
in interface org.newdawn.slick.MouseListener
public void mouseReleased(int button, int x, int y)
mouseReleased
in interface org.newdawn.slick.MouseListener
public void mouseWheelMoved(int change)
mouseWheelMoved
in interface org.newdawn.slick.MouseListener
public boolean contains(java.lang.String rawText)