View Single Post
Old 04-05-2019, 09:38 PM   #2
JamesPeters
Human being with feelings
 
Join Date: Aug 2011
Location: Near a big lake
Posts: 3,943
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.
JamesPeters is offline   Reply With Quote