Class Text
-
-
Field Summary
-
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 BooleangetStrikethrough()final UnitsetStrikethrough(Boolean strikethrough)final BooleangetUnderline()final UnitsetUnderline(Boolean underline)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 Font.WeightgetFontWeight()final UnitsetFontWeight(Font.Weight fontWeight)final BooleangetItalic()final UnitsetItalic(Boolean italic)final FloatgetFontSize()final UnitsetFontSize(Float fontSize)Unitrescale(Float scaleX, Float scaleY, Boolean position)Method that is called when the physical size of the total window area changes. Booleansetup(PolyUI polyUI)give this a PolyUI reference. UnitupdateTextBounds(Renderer renderer)Vec2calculateSize()Use this function to calculate the size of this drawable. StringdebugString()Override this function to add things to the debug display of this drawable. -
Methods inherited from class org.polyfrost.polyui.component.Drawable
accept, addChild, addChild, addEventHandler, addEventhandler, addOperation, addOperation, at, at, canBeRemoved, clipChildren, clone, debugDraw, draw, get, get, get, getAcceptsInput, getAlignment, getAlpha, getAtValid, getChildren, getColor, getEnabled, getFocusable, getFramebuffer, getHasVisibleSize, getHeight, getInitialized, getInputState, getNeedsRedraw, getOperating, getPalette, getParent, getParent0, getPolyUI, getRawResize, getRenderer, getRenders, getRotation, getScaleX, getScaleY, getScrolling, getSimpleName, getSize, getSizeValid, getSkewX, getSkewY, getVisibleSize, getVisibleSize0, getWidth, getX, getY, get_x, get_y, hasListenersFor, intersects, isInside, recalculate, recalculateChildren, removeChild, removeChild, removeOperation, reset, resetScroll, set, set, setAcceptsInput, setAlpha, setColor, setEnabled, setHeight, setInputState, setNeedsRedraw, setPalette, setParent, setParent0, setRawResize, setRenders, setRotation, setScaleX, setScaleY, setSimpleName, setSize, setSkewX, setSkewY, setVisibleSize, setVisibleSize0, setWidth, setX, setY, set_x, set_y, toString, tryMakeScrolling -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getStrikethrough
final Boolean getStrikethrough()
- Since:
1.0.6
-
setStrikethrough
final Unit setStrikethrough(Boolean strikethrough)
- Since:
1.0.6
-
getUnderline
final Boolean getUnderline()
- Since:
1.0.6
-
setUnderline
final Unit setUnderline(Boolean underline)
- Since:
1.0.6
-
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)
-
getFontWeight
final Font.Weight getFontWeight()
-
setFontWeight
final Unit setFontWeight(Font.Weight fontWeight)
-
getFontSize
final Float getFontSize()
-
setFontSize
final Unit setFontSize(Float fontSize)
-
rescale
Unit rescale(Float scaleX, Float scaleY, Boolean position)
Method that is called when the physical size of the total window area changes.
- Parameters:
position- weather to scale the at property of this drawable as well.
-
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
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.
-
debugString
String debugString()
Override this function to add things to the debug display of this drawable.
- Since:
1.1.1
-
-
-
-