Class Slider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classSlider.ChangedEvent
-
Field Summary
Fields Modifier and Type Field Description private final SliderPropertiespropertiesprivate transient Color.AnimatedbarColorprivate transient Color.AnimatedusedBarColorprivate final transient Booleanhorizontalprivate Floatmainprivate Floatcrossprivate Floatvalueprivate final Floatminprivate final Floatmaxprivate transient Color.Animatedcolorprivate transient Drawableparentprivate transient Layoutlayoutprivate transient BooleanconsumesHoverprivate Booleandisabledprivate Vec2<Unit>sizeprivate final transient HashMap<Event, Function2<Drawable, Event, Boolean>>eventHandlersprivate transient StringsimpleNameprivate transient Rendererrendererprivate transient PolyUIpolyUIprivate BooleanacceptsInputprivate final transient ByteinitStageprivate final transient BooleanmouseOverprivate Booleanrendersprivate Floatxprivate Floatyprivate Floatwidthprivate Floatheightprivate Booleanexistsprivate transient FloattrueXprivate transient FloattrueYprivate final Unit.TypeatTypeprivate final Unit.TypesizeTypeprivate final BooleanisDynamicprivate Doublerotationprivate DoubleskewXprivate DoubleskewYprivate FloatscaleXprivate FloatscaleYprivate Floatalphaprivate transient Floatacxprivate transient Floatacyprivate final Vec2<Unit>atprivate final BooleanrawResize
-
Method Summary
Modifier and Type Method Description SliderPropertiesgetProperties()final Color.AnimatedgetBarColor()final UnitsetBarColor(Color.Animated barColor)final Color.AnimatedgetUsedBarColor()final UnitsetUsedBarColor(Color.Animated usedBarColor)final BooleangetHorizontal()final FloatgetMain()final UnitsetMain(Float main)final FloatgetCross()final UnitsetCross(Float cross)final FloatgetValue()final UnitsetValue(Float value)final FloatgetMin()final FloatgetMax()Unitsetup(Renderer renderer, PolyUI polyUI)give this a renderer reference and a PolyUI reference. Booleanaccept(Event event)called when this drawable receives an event. Unitrender()draw script for this drawable. UnitonColorsChanged(Colors colors)Function that is called when the colors attached to this drawable change. Unitrescale(Float scaleX, Float scaleY)Method that is called when the physical size of the total window area changes. UnitcalculateBounds()Calculate the position and size of this drawable. -
Methods inherited from class org.polyfrost.polyui.component.Component
addKeyframes, addOperation, canBeRemoved, debugRender, draggable, every, getColor, getConsumesHover, getDisabled, getLayout, getParent, getSize, onFontsChanged, preRender, recolor, setColor, setConsumesHover, setDisabled, setLayout, setParent, setProperties, setSize, toString, trueX, trueY, wantRedraw -
Methods inherited from class org.polyfrost.polyui.component.Drawable
addEventHandler, addEventhandler, animateBy, animateTo, calculateSize, clone, debugPrint, doDynamicSize, events, fadeBy, fadeTo, getAcceptsInput, getAcx, getAcy, getAlpha, getAt, getAtType, getContainingLayout, getEventHandlers, getExists, getHeight, getInitStage, getMouseOver, getPolyUI, getRawResize, getRenderer, getRenders, getRotation, getScaleX, getScaleY, getSimpleName, getSizeType, getSkewX, getSkewY, getTrueX, getTrueY, getWidth, getX, getY, intersects, isDynamic, isInside, isInside, moveBy, moveTo, onInitComplete, onParentInitComplete, postRender, removeOperation, reset, resize, rotateBy, rotateTo, scaleBy, scaleTo, setAcceptsInput, setAcx, setAcy, setAlpha, setExists, setHeight, setPolyUI, setRenderer, setRenders, setRotation, setScaleX, setScaleY, setSimpleName, setSkewX, setSkewY, setTrueX, setTrueY, setWidth, setX, setY, skewBy, skewTo -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getProperties
SliderProperties getProperties()
-
getBarColor
final Color.Animated getBarColor()
-
setBarColor
final Unit setBarColor(Color.Animated barColor)
-
getUsedBarColor
final Color.Animated getUsedBarColor()
-
setUsedBarColor
final Unit setUsedBarColor(Color.Animated usedBarColor)
-
getHorizontal
final Boolean getHorizontal()
-
setup
Unit setup(Renderer renderer, PolyUI polyUI)
give this a renderer reference and a PolyUI reference.
You can also use this method to do some calculations (such as text widths) that are not dependent on other sizes.
If you need a method that has access to component's sizes, see here or here (if you are operating on yourself only).
this method is called once, and only once.
-
accept
Boolean accept(Event event)
called when this drawable receives an event.
make sure to call Drawable.accept!
-
onColorsChanged
Unit onColorsChanged(Colors colors)
Function that is called when the colors attached to this drawable change.
If this is a layout, the colors will change, and all its children and components will be notified and updated accordingly.
Make sure to call super.onColorsChanged() if you override this!
-
rescale
Unit rescale(Float scaleX, Float scaleY)
Method that is called when the physical size of the total window area changes.
-
calculateBounds
Unit calculateBounds()
Calculate the position and size of this drawable. Make sure to call doDynamicSize in this method to avoid issues with sizing.
This method is called once the layout is populated for children and component, and when a recalculation is requested.
The value of layout's bounds will be updated after this method is called, so do not use layout's bounds as an updated value in this method.
-
-
-
-