Class ExtensionsKt

  • All Implemented Interfaces:

    
    public final class ExtensionsKt
    
                        
    • Constructor Detail

    • 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.

      • 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

      • 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 Event.Lifetime.PostInit 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.