Author Topic: Auto pan effect on a large image  (Read 2003 times)

walknight

  • Newbie
  • *
  • Posts: 24
  • Karma: +4/-1
    • View Profile
Auto pan effect on a large image
« on: May 08, 2020, 05:16:14 PM »
I want to show case some posters that do not fit entirely on the screen due to their aspect ratio. I'm using the following animation to zoom in and slowly pan around the large image.

Code: [Select]
<reloadableImage type="cover" alpha="1" width="2000" xOrigin="center" x="center" yOrigin="center" y="center" xOffset="-200" yOffset="-200" layer="2">
    <onIdle>
        <set duration="6">
            <animate type="xOffset" from="-200" to="200" algorithm="easeinquadratic"/>
        </set>
        <set duration="6">
            <animate type="yOffset" from="-200" to="200" algorithm="easeinquadratic"/>
        </set>
        <set duration="6">
            <animate type="xOffset" from="200" to="-200" algorithm="easeinquadratic"/>
        </set>
        <set duration="6">
            <animate type="yOffset" from="200" to="-200" algorithm="easeinquadratic"/>
        </set>         
    </onIdle>
</reloadableImage>

It looks great but if the images have different sizes, the displacement needs to be adjusted accordingly.
It would be nice if we can have an "auto-pan" image type that does this automatically.