Class Text
-
-
Field Summary
Fields Modifier and Type Field Description private 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
-
Constructor Summary
Constructors Constructor Description Text(String text, Font font, Float fontSize, Vec2 at, Align alignment, Float wrap, Vec2 visibleSize, Boolean focusable, Drawable children)Text(Translator.Text text, Font font, Float fontSize, Vec2 at, Align alignment, Float wrap, Vec2 visibleSize, Boolean focusable, Drawable children)
-
Method Summary
Modifier and Type Method Description final FloatgetWrap()final UnitsetWrap(Float wrap)final Translator.Textget_translated()final Unitset_translated(@Deprecated(message = "Internal object, use text instead", replaceWith = @ReplaceWith(imports = {}, expression = "text"), level = DeprecationLevel.ERROR) @ApiStatus.Internal() Translator.Text _translated)final StringgetText()final UnitsetText(String text)final FontgetFont()final UnitsetFont(Font font)final FloatgetFontSize()final UnitsetFontSize(Float fontSize)Unitrescale(Float scaleX, Float scaleY)Method that is called when the physical size of the total window area changes. Booleansetup(PolyUI polyUI)give this a PolyUI reference. final UnitupdateTextBounds(Renderer renderer)Vec2calculateSize()Use this function to calculate the size of this drawable. -
Methods inherited from class org.polyfrost.polyui.component.Drawable
accept, 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
-
get_translated
final Translator.Text get_translated()
-
set_translated
final Unit set_translated(@Deprecated(message = "Internal object, use text instead", replaceWith = @ReplaceWith(imports = {}, expression = "text"), level = DeprecationLevel.ERROR) @ApiStatus.Internal() Translator.Text _translated)
-
getFontSize
final Float getFontSize()
-
setFontSize
final Unit setFontSize(Float fontSize)
-
rescale
Unit rescale(Float scaleX, Float scaleY)
Method that is called when the physical size of the total window area changes.
-
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.
-
updateTextBounds
final Unit updateTextBounds(Renderer renderer)
-
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.
-
-
-
-