Attract-Mode Support Forum
Attract-Mode Support => Scripting => Topic started by: FrizzleFried on April 10, 2018, 01:41:12 PM
-
Is it possible to have a video snap window with ZERO alpha for 'x' number of seconds... at which time the alpha would jump to 100% only to drop back to ZERO at change of game.
Essentially, I have a snap on a "carrier" that I want to overlay a video on after 3 or 4 seconds...
I have the video positioned, but the conveyor runs behind the video. I found a neat bit of code that pauses the video for a time at selection, but the video "box" remains opaque.... not transparent... so you can't see the snap behind it.
Ideally I'd have a video box sitting there with zero alpha for x seconds at which time alpha would change to 100... again changing back to 0 at selection for a new game. I've tried a few different timing methods ...all fail... but I'm merely a hack... so I figured I'd ask.
:D
-
Yes. Check out my fadetogame module transitions function for changing alpha over time. Your going to want to create a class/transitions that will wait a certain amount of ticks and then do the fade like in my module. Could even make a module/class that would create the transitions for objects, wait time, and fade time - if you wanted to get fancy and end up reusing it often.
https://github.com/keilmillerjr/fadetogame-plugin/blob/master/plugin.nut
-
sounds like your back on SD :D hope that u succeed in what your after...
it will be cool.....thanks
-
Is it possible to have a video snap window with ZERO alpha for 'x' number of seconds... at which time the alpha would jump to 100% only to drop back to ZERO at change of game.
Essentially, I have a snap on a "carrier" that I want to overlay a video on after 3 or 4 seconds...
I have the video positioned, but the conveyor runs behind the video. I found a neat bit of code that pauses the video for a time at selection, but the video "box" remains opaque.... not transparent... so you can't see the snap behind it.
Ideally I'd have a video box sitting there with zero alpha for x seconds at which time alpha would change to 100... again changing back to 0 at selection for a new game. I've tried a few different timing methods ...all fail... but I'm merely a hack... so I figured I'd ask.
:D
This is what I made for "videothemes" just change for snap or wathever you want.
/////////////////////
// Videotheme
/////////////////////
::OBJECTS1 <- {
artwork_videotheme = fe.add_artwork("videotheme", 0, 0 flw, flh),
}
OBJECTS1.artwork_videotheme.visible=false;
::videoSound <- Vid.NoAudio;
OBJECTS1.artwork_videotheme.video_flags = videoSound;
local settings = {
delay_timer = 0,
play_delay = 25000,
stop_play = 35000,
}
function on_transition_videotheme( ttype, var, ttime ) {
switch ( ttype ) {
case Transition.StartLayout:
case Transition.ToNewSelection:
case Transition.ToNewList:
case Transition.EndNavigation:
OBJECTS1.artwork_videotheme.video_flags = Vid.NoAutoStart;
settings.delay_timer = fe.layout.time;
OBJECTS1.artwork_videotheme.visible=false;
break;
}
return false;
}
fe.add_transition_callback( "on_transition_videotheme" );
function on_tick_videotheme(tick_time) {
if ( !OBJECTS1.artwork_videotheme.video_playing && tick_time - settings.delay_timer >= settings.play_delay ) {
OBJECTS1.artwork_videotheme.video_playing = true;
::videoSound <- Vid.NoAudio;
OBJECTS1.artwork_videotheme.video_flags = videoSound;
OBJECTS1.artwork_videotheme.visible=true;
OBJECTS1.artwork_videotheme.alpha = 0
local alpha_artwork_videotheme_0 = {
property = "alpha", start = 0 end = 255, time = 2000 easing = Easing.Out,
}
animation.add( PropertyAnimation( OBJECTS1.artwork_videotheme, alpha_artwork_videotheme_0 ) );
}
else if ( tick_time - settings.delay_timer >= settings.stop_play ) {
OBJECTS1.artwork_videotheme.visible=false;
}
}
fe.add_ticks_callback(this, "on_tick_videotheme");
This is the delay time to play and the total time before close the snap.
play_delay = 25000,
stop_play = 35000,
-
AWESOME... I will try these two solutions out today likely...
:D
Thanks...
-
qqplayer...
YOU'RE THE MAN!
https://youtu.be/fDfYnC1WnJk
All I need to do now is figure out how to handle the small audio issue... (no time, going to work). Basically, if the movie volume is up, you get about 1/4-1/2 second of audio then silence...ideally the volume would "fade in" as well... we'll see. Set movie volume to zero and it works great (with no volume of course, but who uses volume in their front ends?!? :) )
Durr... a simple one word change from NoAudio to Default and BOOM... it's working!
THANKS MAN!
You can grab it HERE (https://www.amazon.com/clouddrive/share/6xma32C5m3AU2SxWi4M0Kd1tQmnwm13NXRosMZTqW9b)if you want it!
-
i new it... thanks for the quick upload of it.....great work
now i love this theme.......even moore :D
-
I dig the simplicity of it... it just... works great.