diff --git a/app/src/main/java/com/annimon/hotarufx/ui/controller/EditorController.java b/app/src/main/java/com/annimon/hotarufx/ui/controller/EditorController.java index 60a1649..37ce1b5 100644 --- a/app/src/main/java/com/annimon/hotarufx/ui/controller/EditorController.java +++ b/app/src/main/java/com/annimon/hotarufx/ui/controller/EditorController.java @@ -274,6 +274,8 @@ public class EditorController implements Initializable, DocumentListener { map.put("Rectangle", "rectangle.hfx"); map.put("Round Rectangle", "round-rect.hfx"); map.put("Font", "font.hfx"); + map.put("Image", "image.hfx"); + map.put("Image Rotate & Zoom", "image_rotate_zoom.hfx"); map.put("Text Clipping", "clip-text.hfx"); map.put("Blend Modes", "blend-modes.hfx"); map.put("Stroke Ants", "stroke-ants.hfx"); diff --git a/app/src/main/resources/examples/image.hfx b/app/src/main/resources/examples/image.hfx new file mode 100644 index 0000000..b871c46 --- /dev/null +++ b/app/src/main/resources/examples/image.hfx @@ -0,0 +1,21 @@ +composition(1280, 720, 30) + +IMG = image("http://lorempixel.com/1280/720/city", { + x: -160, + y: -120, + smooth: true, + fitWidth: 320, + fitHeight: 240 +}) + +easing = easeOut + +IMG@x.add(1 sec, -960, easing) +IMG@y.add(1 sec, -540, easing) + +IMG@fitWidth + .add(1 sec, 1920, easing) +IMG@fitHeight + .add(1 sec, 1080, easing) + +render(IMG) \ No newline at end of file diff --git a/app/src/main/resources/examples/image_rotate_zoom.hfx b/app/src/main/resources/examples/image_rotate_zoom.hfx new file mode 100644 index 0000000..aeb5491 --- /dev/null +++ b/app/src/main/resources/examples/image_rotate_zoom.hfx @@ -0,0 +1,33 @@ +composition(1280, 720, 30) + +IMG = image("http://lorempixel.com/1280/720/city", { + x: -160, + y: -120, + smooth: true, + fitWidth: 320, + fitHeight: 240, + opacity: 0 +}) + +easing = easeOut + +IMG@opacity.add(0.5 sec, 1) + +IMG@x.add(1 sec, -960, easing) +IMG@y.add(1 sec, -540, easing) + +IMG@fitWidth + .add(1 sec, 1920, easing) +IMG@fitHeight + .add(1 sec, 1080, easing) + +angle = 10 +IMG@rotate + .add(1.4 sec, 0, hold) + .add(1.7 sec, angle, easeOut) + .add(1.9 sec, angle, hold) + .add(2.5 sec, -angle, ease) + .add(2.7 sec, -angle, hold) + .add(3 sec, 0, ease) + +render(IMG)