Class VisualsKt

  • All Implemented Interfaces:

    
    public final class VisualsKt
    
                        
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final static <S extends Drawable> S withStates(S $self)
      final static <S extends Drawable> S withStates(S $self, Boolean consume, Boolean showClicker, Function0<Animation> animation)
      final static <S extends Drawable> S withCursor(S $self, Cursor cursor)
      final static <S extends Block> S withBoarder(S $self, PolyColor color, Float width)
      final static <S extends Block> S withBoarder(S $self, Float width, Function1<Colors, PolyColor> color)
      final static <S extends Drawable> S fade(S $self, Boolean in, Long durationNanos) Fade this drawable in or out, with a given duration.
      final static <S extends Drawable> S fadeIn(S $self, Long durationNanos) Alias for fade.
      final static <S extends Drawable> S fadeOut(S $self, Long durationNanos) Alias for fade.
      final static <S extends Component> S shake(S $self)
      final static <S extends Drawable> S toggleable(S $self, Boolean default) Make this drawable toggleable, meaning that, when clicked:
      • it will change its palette to the brand foreground color if it is toggled on, and to the component background color if it is toggled off.

      • it will emit a Event.Change.State event. you can use the onToggle function to easily listen to this event.

      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.
      final static <S extends Drawable> S setPalette(S $self, Colors.Palette palette)
      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.
      final static <S extends Text> S secondary(S $self)
      final static <S extends Drawable> S setDestructivePalette(S $self)
      final static <S extends Text> S setFont(S $self, Function1<FontFamily, Font> font) Set the font of this text component during initialization, using the PolyUI fonts instance.
      final static <S extends Block> S radius(S $self, Float radius)
      final static <S extends Block> S radii(S $self, FloatArray radii)
      final static <S extends Block> S radii(S $self, Float topLeftRadius, Float topRightRadius, Float bottomLeftRadius, Float bottomRightRadius)
      final static <S extends Drawable> S add3dEffect(S $self, Double xIntensity, Double yIntensity) Add a 3D hover effect to the specified drawable which slightly skews the object as the mouse moves across it, giving the appearance of it popping off the screen.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • fade

         final static <S extends Drawable> S fade(S $self, Boolean in, Long durationNanos)

        Fade this drawable in or out, with a given duration.

        If it is not initialized, it applies the fade instantly.

        Since:

        1.5.0

      • fadeIn

         final static <S extends Drawable> S fadeIn(S $self, Long durationNanos)

        Alias for fade.

      • fadeOut

         final static <S extends Drawable> S fadeOut(S $self, Long durationNanos)

        Alias for fade.

      • toggleable

         final static <S extends Drawable> S toggleable(S $self, Boolean default)

        Make this drawable toggleable, meaning that, when clicked:

        • it will change its palette to the brand foreground color if it is toggled on, and to the component background color if it is toggled off.

        • it will emit a Event.Change.State event. you can use the onToggle function to easily listen to this event.

        Since:

        1.5.0

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

      • setFont

         final static <S extends Text> S setFont(S $self, Function1<FontFamily, Font> font)

        Set the font of this text component during initialization, using the PolyUI fonts instance.

        Since:

        1.1.3

      • radii

         final static <S extends Block> S radii(S $self, Float topLeftRadius, Float topRightRadius, Float bottomLeftRadius, Float bottomRightRadius)
      • add3dEffect

         final static <S extends Drawable> S add3dEffect(S $self, Double xIntensity, Double yIntensity)

        Add a 3D hover effect to the specified drawable which slightly skews the object as the mouse moves across it, giving the appearance of it popping off the screen.

        Since:

        1.6.01