Class Text
-
-
Field Summary
Fields Modifier and Type Field Description private final BooleanisSingleLineprivate transient Floatwrapprivate final Translator.Text_translatedprivate Stringtextprivate transient Fontfontprivate transient FloatfontSizeprivate Vec2sizeprivate Vec2visibleSizeprivate final Drawableparentprivate Vec2atprivate BooleanrawResizeprivate transient StringsimpleNameprivate final LinkedList<Drawable>childrenprivate final transient PolyUIpolyUIprivate final Rendererrendererprivate Framebufferframebufferprivate PolyColor.Animatedcolorprivate transient Colors.Palettepaletteprivate Floatxprivate Floatyprivate Floatwidthprivate Floatheightprivate FloatvisibleWidthprivate FloatvisibleHeightprivate 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 BooleanisSingleLine()final FloatgetWrap()final UnitsetWrap(Float wrap)final Translator.Textget_translated()final StringgetText()final UnitsetText(String text)final FontgetFont()final UnitsetFont(Font font)final FloatgetFontSize()final UnitsetFontSize(Float fontSize)Unitsetup(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.Drawable
accept, addChild, addChild, addEventHandler, addEventhandler, addOperation, addOperation, canBeRemoved, clipDrawables, 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, rescale, reset, 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
-
isSingleLine
final Boolean isSingleLine()
-
get_translated
final Translator.Text get_translated()
-
getFontSize
final Float getFontSize()
-
setFontSize
final Unit setFontSize(Float fontSize)
-
setup
Unit 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.
-
-
-
-