View Single Post
Old 04-05-2019, 05:23 AM   #1
David Else
Human being with feelings
 
David Else's Avatar
 
Join Date: Mar 2012
Location: Near London, UK
Posts: 576
Default How can I adapt the text overlay preset to alter the border?

Hi, I would like to be able to change the border so it does not take the full length of the screen but instead just surrounds the text. Is this an easy mod?

Cheers! Here is the preset unaltered:

// Text overlay
#text=""; // set to string to override
font="Arial";

//@param1:size 'text height' 0.05 0.01 0.2 0.1 0.001
//@param2:ypos 'y position' 0.95 0 1 0.5 0.01
//@param3:xpos 'x position' 0 0 1 0.5 0.01
//@param4:border 'border' 0 0 1 0.5 0.01
//@param5:fgc 'text bright' 1.0 0 1 0.5 0.01
//@param6:fga 'text alpha' 1.0 0 1 0.5 0.01
//@param7:bgc 'bg bright' 0.75 0 1 0.5 0.01
//@param8:bga 'bg alpha' 0.5 0 1 0.5 0.01
//@param10:ignoreinput 'ignore input' 0 0 1 0.5 1

input = ignoreinput ? -2:0;
project_wh_valid===0 ? input_info(input,project_w,project_h);
gfx_a2=0;
gfx_blit(input,1);
gfx_setfont(size*project_h,font);
strcmp(#text,"")==0 ? input_get_name(-1,#text);
gfx_str_measure(#text,txtw,txth);
yt = (project_h- txth*(1+border*2))*ypos;
gfx_set(bgc,bgc,bgc,bga);
gfx_fillrect(0, yt, project_w, txth*(1+border*2));
gfx_set(fgc,fgc,fgc,fga);
gfx_str_draw(#text,xpos * (project_w-txtw),yt+txth*border);
__________________
----------> Fedora Linux Distribution = Computing Joy & Freedom <----------
Learn Digital Audio Home | 'Nebula Explained' Course Out Now! | YouTube Channel | Twitter
David Else is offline   Reply With Quote