View Single Post
Old 12-22-2018, 09:12 AM   #4
Eliseat
Human being with feelings
 
Eliseat's Avatar
 
Join Date: Mar 2018
Location: Cologne
Posts: 1,167
Default

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);
The last parameter changes the spacing of the box. I hope it works as expected. I'm pretty happy right now.

And it was kind of fun.

But now I have to go!
Eliseat is online now   Reply With Quote