Class VisualsKt
-
- All Implemented Interfaces:
public final class VisualsKt
-
-
Method Summary
Modifier and Type Method Description final static <S extends Drawable> SwithHoverStates(S $self)final static <S extends Drawable> SwithHoverStates(S $self, Boolean consume, Boolean showClicker, Function0<Animation> animation)final static <S extends Drawable> SwithCursor(S $self, Cursor cursor)final static <S extends Block> SwithBorder(S $self, PolyColor color, Float width)final static <S extends Block> SwithBorder(S $self, Float width, Function1<Colors, PolyColor> color)final static <S extends Drawable> Sfade(S $self, Boolean in, Long durationNanos)Fade this drawable in or out, with a given duration. final static <S extends Drawable> SfadeIn(S $self, Long durationNanos)Alias for fade. final static <S extends Drawable> SfadeOut(S $self, Long durationNanos)Alias for fade. final static <S extends Component> Sshake(S $self)final static <S extends Drawable> Stoggleable(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> 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> SsetPalette(S $self, Colors.Palette palette)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 Text> Ssecondary(S $self)final static <S extends Drawable> SsetDestructivePalette(S $self)final static <S extends Text> SsetFont(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> Sradius(S $self, Float radius)final static <S extends Block> Sradii(S $self, FloatArray radii)final static <S extends Block> Sradii(S $self, Float topLeftRadius, Float topRightRadius, Float bottomLeftRadius, Float bottomRightRadius)final static <S extends Drawable> Sadd3dEffect(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. -
-
Method Detail
-
withHoverStates
final static <S extends Drawable> S withHoverStates(S $self)
-
withHoverStates
final static <S extends Drawable> S withHoverStates(S $self, Boolean consume, Boolean showClicker, Function0<Animation> animation)
-
withCursor
final static <S extends Drawable> S withCursor(S $self, Cursor cursor)
-
withBorder
final static <S extends Block> S withBorder(S $self, PolyColor color, Float width)
-
withBorder
final static <S extends Block> S withBorder(S $self, Float width, Function1<Colors, PolyColor> color)
-
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
-
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, Colors.Palette palette)
-
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.
-
setDestructivePalette
final static <S extends Drawable> S setDestructivePalette(S $self)
-
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, FloatArray radii)
-
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
-
-
-