Repository navigation
Animations
Property animations, keyframes, timelines, easing curves and springs.
Any style property can be animated. Animations write to a separate layer, so hover and pressed styles keep working underneath, and animations stop by themselves when an element is removed.
box.animate(Styles.TRANSLATE_X).keyframe(0, 0f).keyframe(0.5f, 160f, Easing.OUT_BOUNCE).keyframe(1, 0f)
.duration(2.4f).loop().play();
element.play(Motion.sequence(
Motion.call(this::sound),
Motion.parallel(a.animate(Styles.OPACITY).to(1f).motion(), b.animate(Styles.SCALE).to(1.2f).motion()),
Motion.delay(0.2f),
VanillaFx.shake(element, 4f, 0.4f)));
AnimatedFloat x = new AnimatedFloat(root.animator(), 0).spring(Spring.BOUNCY); // for your own widgets
x.animateTo(100);23 easing curves (Easing), cubicBezier, steps, springs.
// Any style property, keyframes, loops and yoyo:
box.animate(Styles.TRANSLATE_X).keyframe(0, 0f).keyframe(0.5f, 160f, Easing.OUT_BOUNCE).keyframe(1, 0f)
.duration(2.4f).loop().play();
box.animate(Styles.BACKGROUND).from(Brush.solid(a)).to(Gradients.NEON).duration(1).yoyo().loops(4).play();
// A timeline made of parts:
element.play(Motion.sequence(
Motion.call(() -> sound()),
Motion.parallel(a.animate(Styles.OPACITY).to(1f).motion(), b.animate(Styles.SCALE).to(1.2f).motion()),
Motion.delay(0.2f),
VanillaFx.shake(element, 4f, 0.4f)));-
Playbackcontrols playback:loops,loop(),yoyo,speed,pause/resume,onFinish. - Animations write to a separate layer above the style, so hover and pressed keep working underneath. When an element is removed from the tree, its animations stop by themselves.
- Curves: 23 built-in (
Easing.presets()), plusEasing.cubicBezier,steps(n),spring(damping, oscillations),reversed()andmirrored().
Начало работы: Установка · Первый экран
Основы: Раскладка · Стили и темы · Цвета и градиенты · Анимации · Данные и сигналы · События и ввод
Виджеты: Каталог виджетов · Всплывающие окна · Формы · Markdown и книги
Игра: Инвентарь и слоты · Окна-контейнеры · Мобы, предметы и 3D · HUD · Карты
Оформление: Эффекты · Размытие, обрезка и GIF
HTML и CSS: HTML и CSS
Возможности: Языки · Экран настроек · Доступность и звуки
Для продвинутых: Расширение · Отладка и советы · Архитектура
Getting started: Installation · Your First Screen
Basics: Layout · Styles and Themes · Colors and Gradients · Animations · Data and Signals · Events and Input
Widgets: Widget Catalog · Popups · Forms · Markdown and Books
Game: Inventory and Slots · Container Screens · Mobs, Items and 3D · HUD Overlay · Maps
Visuals: Effects · Blur, Clipping and GIF
HTML and CSS: HTML and CSS
Features: Languages · Config Screen · Accessibility and Sounds
Advanced: Extending · Debugging and Tips · Architecture