04-05-2019, 05:23 AM | #1 |
Human being with feelings
Join Date: Mar 2012
Posts: 610
|
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);
__________________
----------> Debian Linux Distribution = Computing Joy & Freedom <---------- |
04-05-2019, 09:38 PM | #2 |
Human being with feelings
Join Date: Aug 2011
Location: Near a big lake
Posts: 3,943
|
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); |
04-06-2019, 05:38 AM | #3 |
Human being with feelings
Join Date: Mar 2012
Posts: 610
|
Brilliant, cheers!
__________________
----------> Debian Linux Distribution = Computing Joy & Freedom <---------- |
Thread Tools | |
Display Modes | |
|
|