# Text Overlay plugin example?



## hershey (May 29, 2016)

So, I simply want to show text on the screen over the current scene with a plugin. Can someone show an example?


----------



## ThoNohT (May 30, 2016)

How about the text source we already have: https://github.com/jp9000/obs-studio/tree/master/plugins/text-freetype2


----------



## hershey (May 30, 2016)

ThoNohT said:


> How about the text source we already have: https://github.com/jp9000/obs-studio/tree/master/plugins/text-freetype2



I'll have a look at this, but how would I go about making my own plugin that would display text with that?


----------



## ThoNohT (May 31, 2016)

Follow the contributing guide: https://obsproject.com/forum/threads/getting-started-with-obs-development.21326/


----------



## Jim (Jun 1, 2016)

Just so you're aware, sources can have sub-sources.  So you can create/render the text source from within your own source if you wish, it's perfectly legal.  Just make sure to use obs_source_create_private (which may eventually get deprecated if I make everything technically "private")


----------



## 01F0 (Jun 10, 2016)

I actually wondered the same thing about half a year ago, and got some mighty fine help from Jim. :)

Here's the code to that plugin. I'm not sure if I did everything 'by the book' though, and I didn't use the private thingy, I should implement that as well. But it works.

I created a pointer which I initialized with obs_source_create, pointing out the text source.. Then I used that pointer to modify the text value and to set width/height etc.


----------

