sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    View.draw_text invisible?

    Scheduled Pinned Locked Moved Developers' Forum
    6 Posts 3 Posters 525 Views 3 Watching
    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

      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
      • Dan RathbunD Offline
        Dan Rathbun
        last edited by

        View.drawing_color=

        I'm not here much anymore.

        1 Reply Last reply Reply Quote 0
        • A Offline
          Aerilius
          last edited by

          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
          • thomthomT Offline
            thomthom
            last edited by

            @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

              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
              • thomthomT Offline
                thomthom
                last edited by

                @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
                • First post
                  Last post
                Buy SketchPlus
                Buy SUbD
                Buy WrapR
                Buy eBook
                Buy Modelur
                Buy Vertex Tools
                Buy SketchCuisine
                Buy FormFonts

                Advertisement