draw text? [SOLVED]
On 06/11/2014 at 23:36, xxxxxxxx wrote:
Cinema 4D Version: r14
Platform: Windows ;
Language(s) : C++ ;
is there a function to draw text into the editor window? like there is DrawLine and those functions. I want to show some string next to a handle.. which function should i look at?
On 07/11/2014 at 00:39, xxxxxxxx wrote:
When you filled that bitmap you can draw it in the viewport using BaseDraw's DrawTexture() function.
You find a nice article about this on the C4D Programming blog.
On 07/11/2014 at 01:19, xxxxxxxx wrote:
thank you. i'll check that. a first glance at the functions needed leaves me with a questionmark if it is worth all that... seems quite complex to me. is there a way to access the hud functionality for this kind of things?
On 07/11/2014 at 02:34, xxxxxxxx wrote:
Sebastian is absolutely right. The HUD is realized exactly in this way, with GeClipMap.
And you shouldn't fear. It's not really more complex than BaseBitmap. In fact not too long ago, I reworked one of my private plugins to use GeClipMap instead of BaseBitmap (for the exact same reason, I wanted to draw text into the viewport). Give it a try, it's mainly a matter of replacing BaseBitmap with GeClipMap. Some small adjustments may be needed, but it's not difficult, trust me.
On 07/11/2014 at 02:37, xxxxxxxx wrote:
thanks for the headups. i'll try it out. would it be better to use one big texture for all text elements, or a bunch of smaller ones, each text gets one of these?
On 07/11/2014 at 02:47, xxxxxxxx wrote:
Depends... basically on the number and ratio of used and unused viewport area. I'd start with multiple small ones first.
On 07/11/2014 at 03:01, xxxxxxxx wrote:
... came along this site: http://c4dprogramming.wordpress.com/2012/11/20/drawing-text-in-the-viewport/
On 07/11/2014 at 07:55, xxxxxxxx wrote:
I also have a working example of drawing text on my plugin site called "DrawTextTag".
It contains a very simple little workaround trick that I discovered that fixes the OpenGL drawing problem when drawing things to the screen. Without needing to use a full blown sceenhook to fix it.
On 07/11/2014 at 12:21, xxxxxxxx wrote:
thank you for that