daily pastebin goal
44%
SHARE
TWEET

Untitled

a guest Aug 10th, 2018 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Title text overlay
  2. #text="This is a\nmulti-line title";
  3. font="Arial";
  4.  
  5. //@param1:size 'text height' 0.05 0.01 0.2 0.1 0.01
  6. //@param2:ypos 'y position' 0.95 0 1 0.5 0.01
  7. //@param3:xpos 'x position' 0 0 1 0.5 0.01
  8. //@param4:border 'border' 0 0 1 0.5 0.01
  9. //@param5:fgc 'text bright' 1.0 0 1 0.5 0.01
  10. //@param6:fga 'text alpha' 1.0 0 1 0.5 0.01
  11. //@param7:bgc 'bg bright' 0.75 0 1 0.5 0.01
  12. //@param8:bga 'bg alpha' 0.5 0 1 0.5 0.01
  13.  
  14. input = 0;
  15. !project_wh_valid && input_info(input,w,h) ? ( project_w=w; project_h=h; );
  16. gfx_blit(input,1);
  17. gfx_setfont(size*project_h,font);
  18.  
  19.  
  20. gfx_str_measure(#text,txtw,txth);
  21. yt = (project_h- txth*(1+border*2))*ypos;
  22.  
  23. match(".*\n$",#text)==0 ? #text += "\n";
  24.  
  25. while (match("%0S\n%0s", #text, #sub,#rem))
  26. (
  27.   #text = #rem;
  28.   gfx_str_measure(#sub,txtw,txth);
  29.   gfx_set(bgc,bgc,bgc,bga);
  30.   gfx_fillrect(0, yt, project_w, txth*(1+border*2));
  31.   gfx_set(fgc,fgc,fgc,fga);
  32.   gfx_str_draw(#sub,xpos * (project_w-txtw),yt+txth*border);
  33.   yt += txth;
  34. );
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top