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_points
kills off the drawing operation that succeed it. I try to move all point drawing operations to the end of thedraw
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:
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_points
bug in the old comments...
Advertisement