Class Text
-
-
Field Summary
-
Constructor Summary
Constructors Constructor Description Text(String text, Font font, Float fontSize, Vec2 at, Align alignment, Vec2 visibleSize, Boolean focusable, Boolean limited, Drawable children)Text(Translator.Text text, Font font, Float fontSize, Vec2 at, Align alignment, Vec2 visibleSize, Boolean focusable, Boolean limited, Drawable children)
-
Method Summary
Modifier and Type Method Description final BooleangetStrikethrough()final UnitsetStrikethrough(Boolean strikethrough)final BooleangetUnderline()final UnitsetUnderline(Boolean underline)StringgetText()UnitsetText(String text)final FontgetFontOrNull()final UnitsetFontInternal(@ApiStatus.Internal() Font _font)final FontgetFont()final UnitsetFont(Font font)final Font.WeightgetFontWeight()final UnitsetFontWeight(Font.Weight fontWeight)final BooleangetItalic()final UnitsetItalic(Boolean italic)final FloatgetUFontSize()Tracker for the unscaled fontSize. final UnitsetUFontSize(Float uFontSize)final FloatgetFontSize()Internal, scaled font size. final UnitsetFontSize(@ApiStatus.Internal() 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. final static StringgetModeName(Byte mode)Return the name of the given constant. -
Methods inherited from class org.polyfrost.polyui.component.Drawable
accept, acceptsInput, addChild, addChild, addEventhandler, addOperation, addOperation, at, at, canBeRemoved, clipChildren, clone, createdWithSetPosition, createdWithSetSize, debugDraw, draw, get, get, get, getAlignment, getAlpha, getChildren, getColor, getColorOrNull, getFramebuffer, getHeight, getInputState, getOperations, getPadding, getPalette, getParent, getParentOrNull, getPolyUI, getRenderer, getRenders, getRotation, getScaleX, getScaleY, getShouldScroll, getSimpleName, getSize, getSkewX, getSkewY, getVisibleSize, getWidth, getX, getXInternal, getY, getYInternal, hasListenersFor, hasListenersFor, hasVisibleSize, intersects, isAtValid, isEnabled, isFocusable, isFocused, isInitialized, isInside, isLayoutIgnored, isOperating, isRawResize, isScrolling, isSizeValid, needsRedraw, on, recalculate, removeChild, removeChild, removeOperation, repositionChildren, resetScroll, set, set, setAcceptsInput, setAlpha, setColor, setColorInternal, setEnabled, setHeight, setInputState, setLayoutIgnored, setNeedsRedraw, setPadding, setPalette, setRawResize, setRenders, setRotation, setScaleX, setScaleY, setShouldScroll, setSimpleName, setSkewX, setSkewY, setVisibleSize, setWidth, setX, setXInternal, setY, setYInternal, 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
-
getFontOrNull
final Font getFontOrNull()
-
setFontInternal
final Unit setFontInternal(@ApiStatus.Internal() Font _font)
-
getFontWeight
final Font.Weight getFontWeight()
-
setFontWeight
final Unit setFontWeight(Font.Weight fontWeight)
-
getUFontSize
final Float getUFontSize()
Tracker for the unscaled fontSize. You should set this instead of font size in most cases.
- Since:
1.2.0
-
setUFontSize
final Unit setUFontSize(Float uFontSize)
-
getFontSize
final Float getFontSize()
Internal, scaled font size. You probably should be using uFontSize instead, as this is an internal object.
-
setFontSize
final Unit setFontSize(@ApiStatus.Internal() 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
-
getModeName
final static String getModeName(Byte mode)
Return the name of the given constant.
-
-
-
-