Question

Does anybody know how to do, or where to find some good examples, for scrolling (animating) 2D text using OpenTK framework. I need something like bottom (top) scrolling tickers on news TV channels.

Thanks.

Was it helpful?

Solution

There are many possible approaches to text rendering. The simplest one: use System.Drawing to render your text into a System.Drawing.Bitmap. Afterwards, load this Bitmap into an OpenGL texture and splat it onto a quad for rendering. Animate the text by moving this quad and update the Bitmap/texture whenever the text changes.

Edit: I have written a text rendering example for OpenTK, which you can find here: http://opentk.svn.sourceforge.net/viewvc/opentk/trunk/Source/Examples/OpenGL/1.x/TextRendering.cs?revision=3063&view=markup

Copy the TextRenderer class to your own project and you are good to go. Check the example for usage instructions.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top