Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenTK text animation

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.

like image 373
m1k4 Avatar asked Dec 17 '25 16:12

m1k4


1 Answers

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.

like image 55
The Fiddler Avatar answered Dec 19 '25 04:12

The Fiddler



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!