Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Title text overlay
- #text="This is a\nmulti-line title";
- 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
- input = 0;
- !project_wh_valid && input_info(input,w,h) ? ( project_w=w; project_h=h; );
- gfx_blit(input,1);
- gfx_setfont(size*project_h,font);
- gfx_str_measure(#text,txtw,txth);
- yt = (project_h- txth*(1+border*2))*ypos;
- match(".*\n$",#text)==0 ? #text += "\n";
- while (match("%0S\n%0s", #text, #sub,#rem))
- (
- #text = #rem;
- gfx_str_measure(#sub,txtw,txth);
- 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(#sub,xpos * (project_w-txtw),yt+txth*border);
- yt += txth;
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement