Attract-Mode Support Forum
Attract-Mode Support => Scripting => Topic started 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.
-
Check out: https://github.com/oomek/attract-extra/blob/main/modules/inertia.nut
You could do something like this with a video
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" )
-
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.
-
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.
-
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);
-
Well I downloaded their examples at github and nothing seems to animate using THEIR own layout file. Do I need AM+?
-
Yeah you need Attract Mode + Probably better upgrading to it, as there's been so much more functionality added over base attract mode
-
Just letting everyone know that if you apply a video to a surface , then you can animate as usual. Solved!
-
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