12-22-2018, 06:20 AM | #1 |
Human being with feelings
Join Date: Jan 2007
Location: The Underground Bunker
Posts: 706
|
'Text box' in videoprocessor - possible?
Hi, I need a 'floating text box' - is it possible?
The video preset 'Title text overlay' and Jons (Reaper blog) 'JT: Essential Text Overlay' both have backgrounds filling the entire screen from left to right. The use case examples would be for that 'censured' black box over the eyes or for making a green box for 'chroma keying'. Ideally it should be free size and free placement and of any color. Any help appreciated Thanks -W
__________________
"if DAWs are religions, REAPER is atheism" - The big J __________________ Windows 10x64 | Asus Z170-a i7, 32GB ram | RME-Digiface USB |
12-22-2018, 08:24 AM | #2 |
Human being with feelings
Join Date: Mar 2018
Location: Cologne
Posts: 1,362
|
Let me - a really cool Video processor hacker - tell you something.
I found out that you could manually change the box's start and end by changing the following values. (default Text overlay from dev Reaper) PHP Code:
PHP Code:
project_w -> 100 I changed it to one hundred. And as I understand it right the first value describes the horizontal start of the box and the second value the width from that start point. So in this case the box would be drawn at 100 px until 200 px. It feels like it would be pretty easy to insert just a variable and change it with parameter knobs. But I'm in a hurry right now. Greetings ELi |
12-22-2018, 08:28 AM | #3 |
Human being with feelings
Join Date: Mar 2018
Location: Cologne
Posts: 1,362
|
Change it to this and you will have the perfect text box which moves with the text: Code:
gfx_fillrect(project_w*xpos, yt, txtw, txth*(1+border*2)); Nope this does not work! Though it moves the box it does it not the same way as the Text. edit: Problem is: If xpos is 0, everything is right. If xpos is 0.5, the text centers but the box starts in the middle. If xpos is 1 the box is outside the screen. So we need something to center the box the same way as the text. I short before the brake thru! edit again: Yeah!!! Got it. Found is in the other code. Code:
gfx_fillrect(xpos*(project_w-txtw), yt, txtw, txth*(1+border*2)); Code:
gfx_fillrect(xpos*(project_w-txtw)-10, yt, txtw+20, txth*(1+border*2)); Last edited by Eliseat; 12-22-2018 at 09:03 AM. |
12-22-2018, 09:12 AM | #4 |
Human being with feelings
Join Date: Mar 2018
Location: Cologne
Posts: 1,362
|
Whohooo! My first working code change! (The kids are hungry and I had to make some shopping. But hey, this was more important )
Code:
// Text overlay #text="What is going on? Is there something wrong?"; // 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 '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 //@param9:lrs 'l/r spacing' 0 0 100 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); And it was kind of fun. But now I have to go! |
12-22-2018, 09:26 AM | #5 |
Human being with feelings
Join Date: Jul 2009
Posts: 7,595
|
My take on it
Code:
// JT: Essential filled rectangle // makes a rectangle of any color //@param1:wet 'opacity' 1.0 0 1 0.5 0.01 //@param2:R 'Red' 0.5 0 1 0.5 0.01 //@param3:G 'Green' 0.5 0 1 0.5 0.01 //@param4:B 'Blue' 0.5 0 1 0.5 0.01 //@param6:w1 'Width' 50 2 1920 50 2 //@param7:h1 'Height' 50 2 1080 50 2 //@param9:P1 'X position' 50 0 100 50 1 //@param10:P2 'Y position2' 50 0 100 50 1 src=0; PW=Project_w/100; PH=Project_h/100; gfx_blit(0); gfx_mode=1; gfx_set(R,G,B,wet); //line gfx_gradrect((PW*P1-(w1/2)),(PH*P2-(h1/2)),w1,h1,R,G,B,wet);
__________________
REAPER Video Tutorials, Tips & Tricks and more at The REAPER Blog
Last edited by EpicSounds; 12-22-2018 at 09:37 AM. Reason: better center aligned preset |
12-22-2018, 11:45 AM | #6 |
Human being with feelings
Join Date: Oct 2009
Location: France
Posts: 745
|
Thank you very much to you, both presets go well together.
|
12-22-2018, 03:14 PM | #7 | |
Human being with feelings
Join Date: Jan 2007
Location: The Underground Bunker
Posts: 706
|
Thanks Eli and Jon - great stuff, thanks a lot!
Quote:
I looking forward to using these - perhaps I even get a chance to do it this year! -W
__________________
"if DAWs are religions, REAPER is atheism" - The big J __________________ Windows 10x64 | Asus Z170-a i7, 32GB ram | RME-Digiface USB |
|
12-22-2018, 05:15 PM | #8 | |
Human being with feelings
Join Date: Mar 2018
Location: Cologne
Posts: 1,362
|
Quote:
Thanks |
|
12-30-2018, 07:36 AM | #9 |
Human being with feelings
Join Date: Jan 2007
Location: The Underground Bunker
Posts: 706
|
... 5 characters
__________________
"if DAWs are religions, REAPER is atheism" - The big J __________________ Windows 10x64 | Asus Z170-a i7, 32GB ram | RME-Digiface USB Last edited by Winfield; 12-30-2018 at 07:55 AM. Reason: .. wrong thread |
12-30-2018, 11:28 AM | #10 |
Human being with feelings
Join Date: Mar 2018
Location: Cologne
Posts: 1,362
|
|
12-30-2018, 11:52 AM | #11 |
Human being with feelings
Join Date: Jan 2007
Location: The Underground Bunker
Posts: 706
|
Yeah I posted something here that was intended for another thread, and there's a 5 character minimum - couldn't delete the post above.
-W
__________________
"if DAWs are religions, REAPER is atheism" - The big J __________________ Windows 10x64 | Asus Z170-a i7, 32GB ram | RME-Digiface USB |
12-30-2018, 12:02 PM | #12 |
Human being with feelings
Join Date: Dec 2012
Posts: 13,335
|
Edit->Go advanced->Delete messaage->Delete this message
|
Thread Tools | |
Display Modes | |
|
|