Attract-Mode Support > Themes

Help how to solve attractmode "video_time" and "video_duration" bug

(1/1)

Karlosworkz:
Hello everyone, is someone who has knowledge in the squirrel language could help me?
I'm trying to make a command so when the video reaches the end of the execution an animation is made and I didn't have success!
I used the strings: "video_duration" and "video_time" here is the code I am currently using for the count:


///////////////////////////////////////////

local snapt = fe.add_image("Videos/TESTE1.mp4", flx0.0680, fly0.243, flw0.245, flh0.244);
snapt.alpha = 255;
snapt.video_playing = true;
snapt.preserve_aspect_ratio = false;
snapt.zorder = 0;
local dura;
dura = snapt.video_duration; /// total duration of running video

local tempoatual
tempoatual = snapt.video_time;/// current time of the video

function vv( ttime )
{
        dt.msg = snapt.video_time;

}
fe.add_ticks_callback( this, "vv" )

dt <- fe.add_text ( "", flx0.20, fly0.009, flw0.33, flh0.090 );
dt.zorder = 25
dt.align = Align.Centre;
dt.margin = 0;
dt.bg_alpha = 010;

function code ( ttime )
{

          if (tempoatual >= dura)   ///*when the current time of the video is greater than or ///equal to the duration the video will make a command
          {
               snapt.x=flx0.60
          }
}
fe.add_ticks_callback(  "code" )

////////////////////

kent79:
http://forum.attractmode.org/index.php?topic=3917.0

You may refer my theme of MENU layout - on_tick function. I think it is the answer

Karlosworkz:
Thanks bro, I'll look it up in your theme ;D ;D ;D

Navigation

[0] Message Index

Go to full version