video_text.liq 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. %ifdef video.add_text.gd
  2. # Add a scrolling line of text on video frames.
  3. # @category Source / Video Processing
  4. # @param ~id Force the value of the source ID.
  5. # @param ~color Text color (in 0xRRGGBB format).
  6. # @param ~cycle Cycle text.
  7. # @param ~font Path to ttf font file.
  8. # @param ~metadata Change text on a particular metadata \
  9. # (empty string means disabled).
  10. # @param ~size Font size.
  11. # @param ~speed Speed in pixels per second (0 means no scrolling).
  12. # @param ~x x offset (negative means from right).
  13. # @param ~y y offset (negative means from bottom).
  14. # @param text Text to display.
  15. def video.add_text(~id="",~color=16777215,~cycle=true,
  16. ~font=configure.default_font,
  17. ~metadata="",~size=18,~speed=70,~x=-1,~y=-5,
  18. text,source)
  19. video.add_text.gd(id=id,color=color,cycle=cycle,font=font,metadata=metadata,
  20. size=size,speed=speed,x=x,y=y,text,source)
  21. end
  22. %endif
  23. %ifdef video.add_text.sdl
  24. # Add a scrolling line of text on video frames.
  25. # @category Source / Video Processing
  26. # @param ~id Force the value of the source ID.
  27. # @param ~color Text color (in 0xRRGGBB format).
  28. # @param ~cycle Cycle text.
  29. # @param ~font Path to ttf font file.
  30. # @param ~metadata Change text on a particular metadata \
  31. # (empty string means disabled).
  32. # @param ~size Font size.
  33. # @param ~speed Speed in pixels per second (0 means no scrolling).
  34. # @param ~x x offset (negative means from right).
  35. # @param ~y y offset (negative means from bottom).
  36. # @param text Text to display.
  37. def video.add_text(~id="",~color=16777215,~cycle=true,
  38. ~font=configure.default_font,
  39. ~metadata="",~size=18,~speed=70,~x=-1,~y=-5,
  40. text,source)
  41. video.add_text.sdl(id=id,color=color,cycle=cycle,font=font,metadata=metadata,
  42. size=size,speed=speed,x=x,y=y,text,source)
  43. end
  44. %endif