View Full Version : subtitle,font_angle & animate
trolltuning
19th December 2010, 15:27
Apparently the font_angle in subtitle requires a named argument to work. When I try to include a named argument when using animate it complains. Is there a way around this?
Gavino
19th December 2010, 15:38
Animate does not support passing arguments by name.
Either pass all the Subtitle arguments explicitly by position (at least up to font_angle), or create a wrapper function for Subtitle with just the parameters you want and apply Animate to that instead.
trolltuning
19th December 2010, 16:50
I tried to modify the wrapper function you wrote for some one in another thread and I don't have it quite rightfunction MyTitle(clip c, string text, int "x", int "y", int "first_frame", int "last_frame",
\ int "opacity", int "text_color", int "halo_color",float "font_angle") {
opacity = Default(opacity, 255)
transparency = (255-opacity)*$01000000
text_color = transparency + Default(text_color, $FFFF00)
halo_color = transparency + Default(halo_color, 0)
font_angle =Default(font_angle,0.0)
Subtitle(c, text, x, y, first_frame, last_frame, text_color=text_color, halo_color=halo_color)
}
BlankClip()
Animate(0, 200, "MyTitle", "Hello", 200, 200, 0, 200, 255,0.0,"Hello", 400, 300, 0, 200, 255,67.4)
Gavino
19th December 2010, 17:13
Your arguments to Animate don't match those of MyTitle, and in any case you are not passing font_angle to Subtitle inside the function.
If you only need default opacity and colors, you can cut it down to:
function MyTitle(clip c, string text, int "x", int "y", int "first_frame", int "last_frame", float "font_angle") {
font_angle = Default(font_angle,0.0)
Subtitle(c, text, x, y, first_frame, last_frame, font_angle=font_angle)
}
BlankClip()
Animate(0, 200, "MyTitle", "Hello", 200, 200, 0, 200, 0.0, "Hello", 400, 300, 0, 200, 67.4)
trolltuning
19th December 2010, 19:04
Thanks working now and I managed to add size back in.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.