Class ExtensionsKt
-
- All Implemented Interfaces:
public final class ExtensionsKt
-
-
Method Summary
Modifier and Type Method Description final static <S extends Drawable> Sdraggable(S $self, Boolean withX, Boolean withY, Boolean consumesEvent, Function1<S, Unit> onDrag)Make this component draggable. final static <S extends Drawable> SnamedId(S $self, String name)final static <S extends Drawable> Snamed(S $self, String name)final static <S extends Drawable> Sdisable(S $self, Boolean state)final static <S extends Drawable> SsetPalette(S $self, Function1<Colors, Colors.Palette> palette)Set the color palette of this drawable during initialization, using the PolyUI colors instance. final static <S extends Drawable> SwithStates(S $self, Boolean showClicker, Function0<Animation> animation)final static <S extends Drawable> SsetState(S $self, Byte state)Set the palette of this drawable according to one of the three possible component states in PolyUI. final static <S extends Drawable> Sprioritize(S $self)Prioritize this drawable, meaning it will, in relation to its siblings: drawn last
receive events first
final static <S extends Drawable> SonInit(S $self, Function2<S, Event.Lifetime.Init, Unit> function)final static <S extends Drawable> SafterInit(S $self, Function2<S, Event.Lifetime.PostInit, Unit> function)final static <S extends Drawable> SafterParentInit(S $self, Integer depth, Function1<S, Unit> handler)Add an event handler to this drawable's parent, and (optionally) it's parent's parent (depth). final static <S extends Drawable> Sevents(S $self, Function1<EventDSL<S>, Unit> dsl)final static <S extends Drawable> UnitanimateBy(S $self, Vec2 at, Vec2 size, Double rotation, Float scaleX, Float scaleY, Double skewX, Double skewY, PolyColor color, Animation animation)Bulk add method for all the builtin drawable operations in PolyUI. final static <S extends Drawable> UnitanimateTo(S $self, Vec2 at, Vec2 size, Double rotation, Double skewX, Double skewY, Float scaleX, Float scaleY, PolyColor color, Animation animation)Bulk add method for all the builtin drawable operations in PolyUI. -
-
Method Detail
-
draggable
final static <S extends Drawable> S draggable(S $self, Boolean withX, Boolean withY, Boolean consumesEvent, Function1<S, Unit> onDrag)
Make this component draggable.
- Parameters:
consumesEvent- weather beginning/ending dragging should cancel the corresponding mouse event
-
setPalette
final static <S extends Drawable> S setPalette(S $self, Function1<Colors, Colors.Palette> palette)
Set the color palette of this drawable during initialization, using the PolyUI colors instance.
-
withStates
final static <S extends Drawable> S withStates(S $self, Boolean showClicker, Function0<Animation> animation)
-
setState
final static <S extends Drawable> S setState(S $self, Byte state)
Set the palette of this drawable according to one of the three possible component states in PolyUI.
- Parameters:
state- the state to set.
-
prioritize
final static <S extends Drawable> S prioritize(S $self)
Prioritize this drawable, meaning it will, in relation to its siblings:
drawn last
receive events first
- Since:
2.0.0
-
onInit
final static <S extends Drawable> S onInit(S $self, Function2<S, Event.Lifetime.Init, Unit> function)
-
afterInit
final static <S extends Drawable> S afterInit(S $self, Function2<S, Event.Lifetime.PostInit, Unit> function)
-
afterParentInit
final static <S extends Drawable> S afterParentInit(S $self, Integer depth, Function1<S, Unit> handler)
Add an event handler to this drawable's parent, and (optionally) it's parent's parent (depth).
This is used to run functions that may move or resize this drawable, as if they were ran under this PostInitialization they would be overwritten by the positioning logic.
-
animateBy
final static <S extends Drawable> Unit animateBy(S $self, Vec2 at, Vec2 size, Double rotation, Float scaleX, Float scaleY, Double skewX, Double skewY, PolyColor color, Animation animation)
Bulk add method for all the builtin drawable operations in PolyUI.
The default values of this method are all zeroes, meaning that nothing is done.
This is the "by" version of this method, meaning that each value is added to the current one of this drawable. See the animateTo method for the "to" equivalent, which sets each value to the provided one.
-
animateTo
final static <S extends Drawable> Unit animateTo(S $self, Vec2 at, Vec2 size, Double rotation, Double skewX, Double skewY, Float scaleX, Float scaleY, PolyColor color, Animation animation)
Bulk add method for all the builtin drawable operations in PolyUI.
The default values of this method are all the current ones of this drawable, meaning that nothing is done.
This is the "to" version of this method, meaning that each value is set to the provided one. See the animateBy method for the "by" equivalent, which adds each value to the current one of this drawable.
-
-
-