Class TextInput
-
-
Field Summary
Fields Modifier and Type Field Description private final transient Booleanfocusedprivate final Stringselectionprivate Floatwrapprivate Translator.Text_translatedprivate Stringtextprivate transient Fontfontprivate transient FloatfontSizeprivate Vec2sizeprivate final Vec2visibleSizeprivate final transient Drawableparentprivate Vec2atprivate BooleanrawResizeprivate transient StringsimpleNameprivate final LinkedList<Drawable>childrenprivate final transient PolyUIpolyUIprivate final Rendererrendererprivate final Booleanoperatingprivate PolyColor.Animatedcolorprivate final transient Colors.Palettepaletteprivate Floatxprivate Floatyprivate Floatwidthprivate Floatheightprivate FloatvisibleWidthprivate FloatvisibleHeightprivate transient BooleanneedsRedrawprivate transient BooleanacceptsInputprivate final transient Booleaninitializedprivate transient ByteinputStateprivate transient Booleanrendersprivate Booleanenabledprivate Doublerotationprivate DoubleskewXprivate DoubleskewYprivate FloatscaleXprivate FloatscaleYprivate Floatalphaprivate final Alignalignmentprivate final Booleanfocusable
-
Method Summary
Modifier and Type Method Description final BooleangetFocused()final StringgetSelection()Booleanaccept(Event event)called when this drawable receives an event. final Booleanaccept(Event.Focused event)final UnitmouseInput(Float mouseX, Float mouseY)final UnitselectWordAroundCaret()final UnitmoveLine(Boolean down)final UnittoLastSpace()final UnitdropToLastSpace()final UnittoNextSpace()final Unitback()final Unitforward()final UnitclearSelection()Booleansetup(PolyUI polyUI)give this a PolyUI reference. Vec2calculateSize()Use this function to calculate the size of this drawable. -
Methods inherited from class org.polyfrost.polyui.component.impl.Text
getFont, getFontSize, getText, getWrap, get_translated, rescale, setFont, setFontSize, setText, setWrap, set_translated, updateTextBounds -
Methods inherited from class org.polyfrost.polyui.component.Drawable
addChild, addChild, addEventHandler, addEventhandler, addOperation, addOperation, canBeRemoved, clipChildren, clone, countChildren, debugDraw, debugPrint, draw, get, get, get, getAcceptsInput, getAlignment, getAlpha, getAt, getChildren, getColor, getEnabled, getFocusable, getHeight, getInitialized, getInputState, getNeedsRedraw, getOperating, getPalette, getParent, getPolyUI, getRawResize, getRenderer, getRenders, getRotation, getScaleX, getScaleY, getSimpleName, getSize, getSkewX, getSkewY, getVisibleHeight, getVisibleSize, getVisibleWidth, getWidth, getX, getY, hasParentOf, intersects, isInside, onAllChildren, removeChild, removeChild, removeOperation, repositionChildren, reset, set, set, setAcceptsInput, setAlpha, setAt, setColor, setEnabled, setHeight, setInputState, setNeedsRedraw, setPalette, setRawResize, setRenders, setRotation, setScaleX, setScaleY, setSimpleName, setSize, setSkewX, setSkewY, setVisibleHeight, setVisibleWidth, setWidth, setX, setY, toString, tryMakeScrolling -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getFocused
final Boolean getFocused()
-
getSelection
final String getSelection()
-
accept
Boolean accept(Event event)
called when this drawable receives an event.
- Returns:
true if the event should be consumed (cancelled so no more handlers are called), false otherwise.
-
accept
final Boolean accept(Event.Focused event)
-
mouseInput
final Unit mouseInput(Float mouseX, Float mouseY)
-
selectWordAroundCaret
final Unit selectWordAroundCaret()
-
toLastSpace
final Unit toLastSpace()
-
dropToLastSpace
final Unit dropToLastSpace()
-
toNextSpace
final Unit toNextSpace()
-
clearSelection
final Unit clearSelection()
-
setup
Boolean setup(PolyUI polyUI)
give this a PolyUI reference.
You can also use this method to do some calculations (such as text widths) that are not dependent on other sizes, or operations that require access to PolyUI things, like PolyUI.settings or PolyUI.translator
this method is called once, and only once.
-
calculateSize
Vec2 calculateSize()
Use this function to calculate the size of this drawable. DO NOT include children in this calculation!
This function is only called if no size is supplied to this drawable at initialization. A return value of
nullindicates this drawable is not able to infer its own size, as it is for example, a Block with no reference. A drawable such as Text on the other hand, is able to infer its own size.
-
-
-
-