Clear display text and other coding queries

I have been using 'set-display-text' to put a message on the graphics window, but I can't find any way of clearing that message at a later time. Anybody know?

Also, is there a way of clearing the log window?

And while I am at it, I have a query about classes and objects. If 'robot' is a class containing an object 'leg1', and 'rodney' is an instance of 'robot' in the controller, can I refer (from within the controller for example) to 'the leg1 which belongs to rodney'? e.g. 'rodney.leg1 set-color to (1,1,1).'

That crashed the IDE when I tried it. Is there a syntax for this or do I have to set up and call a method in 'robot' to change the leg color?

Clear display text and other coding queries

Try using set-display-text to " ". The display text can be changed any time you like, which is nice for constantly updated information. It also means that you can clear it by simply setting it to nothing.

As far as the log window, sorry, don't think you can, but I'm not really sure. I think that if you were to use the command-line breve, you may be able to clear what is written out to the console, or have things written to a file, etc.

The 'steve' language uses a slightly different syntax than you are used to, as I'm sure you've noticed. :wink: Instead of using a period, try this:
'rodney leg1 set-color to (1,1,1).
Just use spaces. That probably won't work either, though, since I don't think that kind of inheritance works in 'steve'. As with Java, use getters/setters for accessing variables within other classes:
'rodney set-leg1-color to (1,1,1).'
'Class rodney :
+ variables :
leg1 (object).
etc.etc.etc...
+ to set-leg1-color to newColor (vector):
leg1 set-color to newColor.'

Try something like this.

~Moto

Clear display text and other coding queries

Thanks Moto,

The spaces thing didn't work either, but at least it didn't crash the IDE! The getters/setters way of accessing variables in an object seems a bit long winded compared to the Visual Basic way I was thinking of, but workable.

As for the display text, it is all beginning to make sense!

self set-display-text number 0 to "SLOW" at-x 0.8 at-y 0.9.

self set-display-text number 0 to "".

Which explains where the 'up to 8 messages' comes in.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.