3

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.

m1k4
  • 829
  • 2
  • 12
  • 26

1 Answers1

3

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.

The Fiddler
  • 2,726
  • 22
  • 28
  • thanks a lot, I now dont know shall i use OpenTK, or DirectX cause meanwhile I've done what i needed in DirectX, but now i read that DX dlls are obsolete :/ – m1k4 Jan 18 '11 at 14:55