Attract-Mode Support Forum

Attract-Mode Support => Scripting => Topic started by: justintime on October 06, 2024, 03:49:32 PM

Title: Animate video?
Post by: justintime on October 06, 2024, 03:49:32 PM
I have been using the animate module to animate image based surfaces.   Is it possible to do the same for a video?   So far I have failed miserably, was hoping I could have a video slide in, or even change some of the pinch parameters etc with an animation.  Yes I have something very specific in mind!

Thanks for any pointers.
Title: Re: Animate video?
Post by: zestful on October 07, 2024, 08:16:46 AM
Check out: https://github.com/oomek/attract-extra/blob/main/modules/inertia.nut

You could do something like this with a video

   
Code: [Select]
video = Inertia( video , 1500, "y");

    function moveMainVideo( ttype, var, ttime )
    {
        if( ttype == Transition.FromOldSelection || ttype == Transition.EndNavigation )
        {

            video.tween_all = Tween.Elastic;
            video.loop_y = false;
            video.y = -700;
            video.to_y = 0;
            video.delay_y = 0;
        }
        if( ttype == Transition.ToNewSelection){video.y = -700}

    }

    fe.add_transition_callback( "moveMainVideo" )
Title: Re: Animate video?
Post by: justintime on October 07, 2024, 11:17:39 AM
Interesting!    I am trying that code but I don't think I am following it.   Are you able to create a version of that example that works with a straight copy/paste?    Sorry I am still learning layouts and nut structure.
Title: Re: Animate video?
Post by: zestful on October 07, 2024, 11:32:01 AM
You need to download the inertia.nut from the link I shared, and put it in your modules folder in Attract Mode.

You'll then from your layout.nut file for your theme your working on, want to load the module:     fe.load_module("inertia");  place that before the code example I shared and it should work for you.
 
Title: Re: Animate video?
Post by: zestful on October 07, 2024, 11:33:28 AM
Sorry I'm probably assuming too much here, but make sure your video is named video

e.g.

    local video = fe.add_artwork( "snap", 100,100, 600, 400);
Title: Re: Animate video?
Post by: justintime on October 07, 2024, 11:38:47 AM
Well I downloaded their examples at github and nothing seems to animate using THEIR own layout file.  Do I need AM+?
Title: Re: Animate video?
Post by: zestful on October 07, 2024, 01:49:56 PM
Yeah you need Attract Mode +  Probably better upgrading to it, as there's been so much more functionality added over base attract mode
Title: Re: Animate video?
Post by: justintime on October 10, 2024, 09:09:04 PM
Just letting everyone know that if you apply a video to a surface , then you can animate as usual.  Solved!
Title: Re: Animate video?
Post by: jakabasej8 on November 15, 2024, 11:34:13 PM
Yeah you need Attract Mode +  Probably better upgrading to it, https://spartan-agency.com/services/development (https://spartan-agency.com/services/development) as there's been so much more functionality added over base attract mode https://www.estela.si/stoli- (https://www.estela.si/stoli-)
I agree