Class TextInput
-
-
Field Summary
Fields Modifier and Type Field Description private final transient Booleanfocusedprivate final Stringselectionprivate final BooleanisSingleLineprivate transient Floatwrapprivate final Translator.Text_translatedprivate Stringtextprivate transient Fontfontprivate transient FloatfontSizeprivate Vec2sizeprivate Vec2visibleSizeprivate final transient Drawableparentprivate Vec2atprivate BooleanrawResizeprivate transient StringsimpleNameprivate final LinkedList<Drawable>childrenprivate final transient PolyUIpolyUIprivate final Rendererrendererprivate Framebufferframebufferprivate PolyColor.Animatedcolorprivate final transient Colors.Palettepaletteprivate Floatxprivate Floatyprivate Floatwidthprivate Floatheightprivate FloatvisibleWidthprivate FloatvisibleHeightprivate transient BooleanneedsRedrawprivate transient BooleanacceptsInputprivate final transient Booleaninitializedprivate transient ByteinputStateprivate transient Booleanrendersprivate final BooleanconsumesHoverprivate Booleanenabledprivate Doublerotationprivate DoubleskewXprivate DoubleskewYprivate FloatscaleXprivate FloatscaleYprivate Floatalphaprivate 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()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, isSingleLine, setFont, setFontSize, setText, setWrap, setup -
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, getConsumesHover, getEnabled, getFocusable, getFramebuffer, getHeight, getInitialized, getInputState, getNeedsRedraw, getPalette, getParent, getPolyUI, getRawResize, getRenderer, getRenders, getRotation, getScaleX, getScaleY, getSimpleName, getSize, getSkewX, getSkewY, getVisibleHeight, getVisibleSize, getVisibleWidth, getWidth, getX, getY, intersects, isInside, removeChild, removeChild, removeOperation, repositionChildren, rescale, reset, set, set, setAcceptsInput, setAlignment, setAlpha, setAt, setColor, setEnabled, setFramebuffer, setHeight, setInputState, setNeedsRedraw, setPalette, setRawResize, setRenders, setRotation, setScaleX, setScaleY, setSimpleName, setSize, setSkewX, setSkewY, setVisibleHeight, setVisibleSize, setVisibleWidth, setWidth, setX, setY, toString -
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()
-
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.
-
-
-
-