Attract-Mode Support Forum
Attract-Mode Support => Scripting => Topic started by: dbinott on June 18, 2016, 11:10:05 AM
-
I have looked around but can't really figure out if there is something like that.
-
Try:
fe.load_module("file");
function file_exist(fullpathfilename)
{
try {file(fullpathfilename, "r" );return true;}catch(e){return false;}
}
-
sweet. thanks. worked great!
-
I need help with this file exist function. Trying to make a "default theme" when there is no video theme available. It will check for videotheme/"[Title].mp4". If that file does not exist load a background file and position and size the snap for that background.
I found this this snippet above but I'm not sure how to use it:
If anyone can shed some light on how to use this function it would be greatly appreciated.
-
To illustrate what I mean look at this video: https://www.youtube.com/watch?v=B9wIOi1hLeo&t=18s.
I want to improve this theme so that when there is no recorded hyperspin theme (these are just mp4 files) the snap is not played full screen. In the video you can see what currently happens at 1:15 when there is no video theme available. Thus I want to place the video themes in its own folder and have a check in the theme if the video theme file exists or not and adapt the theme to play the snap in a smaller window.
-
Soo
The file exist code breaks my theme. I load the the module and use this code:
If file_exist("videothemes/[DisplayName]/[Title].mp4"){
local snap = FadeArt( "snap", 0, 0, flw, flh );
snap.trigger = Transition.EndNavigation;
if ( my_config["Preserve_Aspect_Ratio"] == "Yes")
{
snap.preserve_aspect_ratio = true;
}
}
Anyone that can help me find the error?