• Login
sketchucation logo sketchucation
  • Login
ℹ️ GoFundMe | Our friend Gus Robatto needs some help in a challenging time Learn More

View.draw_text invisible?

Scheduled Pinned Locked Moved Developers' Forum
6 Posts 3 Posters 517 Views
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.
  • A Offline
    Aerilius
    last edited by 16 Apr 2012, 03:24

    After drawing points, text is not displayed. Any ideas?
    My workaround is to draw the text first, but I'm just wondering if something else is wrong.

    **```
    class TestTool
    def draw(view)
    view.draw_text(view.screen_coords(ORIGIN)+[20,-100,0], "visible text")
    view.draw_points(ORIGIN+[10,10,10], 10, 3, Sketchup;;Color.new("black"))
    view.draw_text(view.screen_coords(ORIGIN)+[20,-50,0], "invisible text")
    end
    end
    Sketchup.active_model.select_tool(TestTool.new)

    1 Reply Last reply Reply Quote 0
    • D Offline
      Dan Rathbun
      last edited by 16 Apr 2012, 07:05

      View.drawing_color=

      I'm not here much anymore.

      1 Reply Last reply Reply Quote 0
      • A Offline
        Aerilius
        last edited by 16 Apr 2012, 08:01

        In my original code I had set a drawing_color, but text doesn't use it (and the first text works without it).

        1 Reply Last reply Reply Quote 0
        • T Offline
          thomthom
          last edited by 16 Apr 2012, 08:33

          @aerilius said:

          After drawing points, text is not displayed. Any ideas?

          There is a bug where view.draw_points kills off the drawing operation that succeed it. I try to move all point drawing operations to the end of the draw event.

          Just to be sure it doesn't mute any other operations, when I'm done drawing points I draw an line outside the viewport area just to make sure the next operations will work fine.

          @dan rathbun said:

          View.drawing_color=

          Unfortunately the drawing colour is not used for text - it always draws the text in the colour of the foreground color: model.rendering_options['ForegroundColor'] - that's the model edge colour.

          Thomas Thomassen — SketchUp Monkey & Coding addict
          List of my plugins and link to the CookieWare fund

          1 Reply Last reply Reply Quote 0
          • A Offline
            Aerilius
            last edited by 16 Apr 2012, 10:33

            Thanks for explaining this!

            (I hope the API comments will be back at the site at some time.)

            1 Reply Last reply Reply Quote 0
            • T Offline
              thomthom
              last edited by 16 Apr 2012, 10:38

              @aerilius said:

              (I hope the API comments will be back at the site at some time.)

              Yea - I'd made notes about the draw_points bug in the old comments... 😞

              Thomas Thomassen — SketchUp Monkey & Coding addict
              List of my plugins and link to the CookieWare fund

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              1 / 1
              • First post
                1/6
                Last post
              Buy SketchPlus
              Buy SUbD
              Buy WrapR
              Buy eBook
              Buy Modelur
              Buy Vertex Tools
              Buy SketchCuisine
              Buy FormFonts

              Advertisement