Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER for Video Editing/Mangling

Reply
 
Thread Tools Display Modes
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
Old 04-05-2019, 09:38 PM   #2
JamesPeters
Human being with feelings
 
JamesPeters's Avatar
 
Join Date: Aug 2011
Location: Near a big lake
Posts: 2,581
Default

Here's a preset I found somewhere (I don't remember where):

Code:
// Text overlay
#text="Enter text here"; // set to string to override
font="Arial";

//@param1:size 'text height' 0.05 0.01 0.2 0.1 0.01
//@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 'bg height' 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
//@param9:lrs 'bg width' 0 0 600 0.5 1

input = 0;
project_wh_valid===0 ? input_info(input,project_w,project_h);
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(xpos*(project_w-txtw)-lrs, yt, txtw+lrs*2, txth*(1+border*2));
gfx_set(fgc,fgc,fgc,fga);
gfx_str_draw(#text,xpos * (project_w-txtw),yt+txth*border);
It has a resizable background area.
__________________
http://petersamplification.com
Using REAPER for Linux
JamesPeters is offline   Reply With Quote
Old 04-06-2019, 05:38 AM   #3
David Else
Human being with feelings
 
David Else's Avatar
 
Join Date: Mar 2012
Location: Near London, UK
Posts: 576
Default

Brilliant, cheers!
__________________
----------> 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
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 08:55 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.