Class Block
-
-
Field Summary
Fields Modifier and Type Field Description private final BlockPropertiespropertiesprivate transient FloatArraycornerRadiiprivate 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
-
Constructor Summary
Constructors Constructor Description Block(BlockProperties properties, Vec2<Unit> at, Vec2<Unit> size, Boolean rawResize, Boolean acceptInput, Function1<EventDSL<Block>, Unit> events)Block(BlockProperties properties, Vec2<Unit> at, Vec2<Unit> size, Boolean rawResize, Boolean acceptInput)Block(BlockProperties properties, Vec2<Unit> at, Vec2<Unit> size, Boolean rawResize)Block(BlockProperties properties, Vec2<Unit> at, Vec2<Unit> size)Block(Vec2<Unit> at, Vec2<Unit> size)
-
Method Summary
Modifier and Type Method Description BlockPropertiesgetProperties()final FloatArraygetCornerRadii()final UnitsetCornerRadii(FloatArray cornerRadii)Unitrender()draw script for this drawable. Unitsetup(Renderer renderer, PolyUI polyUI)give this a renderer reference and a PolyUI reference. UnitonColorsChanged(Colors colors)Function that is called when the colors attached to this drawable change. -
Methods inherited from class org.polyfrost.polyui.component.Component
accept, addKeyframes, addOperation, calculateBounds, 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, rescale, 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
-
-
Constructor Detail
-
Block
Block(BlockProperties properties, Vec2<Unit> at, Vec2<Unit> size, Boolean rawResize, Boolean acceptInput, Function1<EventDSL<Block>, Unit> events)
-
Block
Block(BlockProperties properties, Vec2<Unit> at, Vec2<Unit> size, Boolean rawResize, Boolean acceptInput)
-
Block
Block(BlockProperties properties, Vec2<Unit> at, Vec2<Unit> size)
-
-
Method Detail
-
getProperties
BlockProperties getProperties()
-
getCornerRadii
final FloatArray getCornerRadii()
-
setCornerRadii
final Unit setCornerRadii(FloatArray cornerRadii)
-
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.
-
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!
- Since:
0.17.5
-
-
-
-