View.draw_text invisible?
-
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) -
-
In my original code I had set a drawing_color, but text doesn't use it (and the first text works without it).
-
@aerilius said:
After drawing points, text is not displayed. Any ideas?
There is a bug where
view.draw_pointskills off the drawing operation that succeed it. I try to move all point drawing operations to the end of thedrawevent.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:
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. -
Thanks for explaining this!
(I hope the API comments will be back at the site at some time.)
-
@aerilius said:
(I hope the API comments will be back at the site at some time.)
Yea - I'd made notes about the
draw_pointsbug in the old comments...
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement