PDA

View Full Version : 2 questions about the gw.text


holycause
09-03-2009, 12:17 AM
I've 2 questions about

I would like to display some informations in the viewport.

I found how to do it. (http://forums.cgsociety.org/showpost.php?p=1633217&postcount=2)

Fn DisplayVolFn =
(
gw.setTransform(matrix3 1)
for o in objects where not o.isHidden do
(
gw.text o.pos ((VolObjFn o)as string) color:yellow
)
gw.enlargeUpdateRect #whole
gw.updateScreen()
)

my first question is:

how could i display my text over my objects and not hidden by them. Like on the 2nd picture below. I would like to display it, if possible, like a ToolTip (3rd picture below).

Second question: I would like to display the result for the object my mouse move over and not for all the objects and all the time. I think I'll have to use the mouseTrack() Fn. Right?

http://aespid.com/Perso/MS/MSViewport.jpg

PEN
09-03-2009, 01:35 AM
Does this help you?

http://penproductions.ca/scripts/screenMessage/PEN_screenMessage.ms
http://penproductions.ca/scripts/screenMessage/PEN_screenMessage.jpg

holycause
09-03-2009, 09:45 AM
I ll look at your script.
Thanks Paul

PEN
09-03-2009, 01:23 PM
For the second problem you will have to do some hit testing and mouseTracks would probably be the best bet there. In my script I allow for placing message beside objects as well as just on the screen. There are several ways that you can display them. You are free to use this script any way you like, just load it and make an instance of the struct and call it with any one or multiple of the parameters that are provided. There is help in the header of the script.

TerianSilva
08-31-2010, 01:56 PM
hey, cool! Thanks paul. I was just looking for a script like this. But I tried it and it is only displaying the grey rectangle but no text at all. No matter what string i provide.

cheers,
marcus

PEN
09-01-2010, 01:27 PM
I have seen problems with it in recent versions of Max. I don't use this any more and go with dotNet solutions instead that have way more control.

Here is an example of it working. What I have is a form laid over the viewport and I'm drawing into it where I need to. Have a look on my web site for the GDI+ drawing methods tutorial.

http://www.paulneale.com/temp/LHM_screenData06.jpg
(http://www.paulneale.com/temp/LHM_screenData06.jpg)

CGTalk Moderation
09-01-2010, 01:27 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.