Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    draw text? [SOLVED]

    SDK Help
    0
    9
    698
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      Helper
      last edited by

      On 06/11/2014 at 23:36, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   r14 
      Platform:   Windows  ;   
      Language(s) :     C++  ;

      ---------
      hi,

      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?

      cheers,
      ello

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        On 07/11/2014 at 00:39, xxxxxxxx wrote:

        Hello,

        you can use the class GeClipMap[URL-REMOVED] to draw into a BaseBitmap. GeClipMap offers the function TextAt()[URL-REMOVED] that allows you to draw a text at a certain position.

        When you filled that bitmap you can draw it in the viewport using BaseDraw's DrawTexture()[URL-REMOVED] function.

        You find a nice article about this on the C4D Programming blog.

        Best wishes,
        Sebastian


        [URL-REMOVED] @maxon: This section contained a non-resolving link which has been removed.

        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          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?

          1 Reply Last reply Reply Quote 0
          • H
            Helper
            last edited by

            On 07/11/2014 at 02:34, xxxxxxxx wrote:

            Hi ello,
            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.

            1 Reply Last reply Reply Quote 0
            • H
              Helper
              last edited by

              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?

              1 Reply Last reply Reply Quote 0
              • H
                Helper
                last edited by

                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.

                1 Reply Last reply Reply Quote 0
                • H
                  Helper
                  last edited by

                  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/

                  1 Reply Last reply Reply Quote 0
                  • H
                    Helper
                    last edited by

                    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.

                    https://sites.google.com/site/scottayersmedia/plugins

                    -ScottA

                    1 Reply Last reply Reply Quote 0
                    • H
                      Helper
                      last edited by

                      On 07/11/2014 at 12:21, xxxxxxxx wrote:

                      thank you for that

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post