Re: selectable objects...
jon klein <[email protected]> Mon, 16 May 2005 09:34:36 -0400
| Newsgroups | gmane.comp.breve |
|---|---|
| Message-ID | <[email protected]> |
On May 15, 2005, at 5:27 PM, Cavan Fyans wrote:
> is it possible to create a ('Mobile') object that cannot be selected
> when the simulation is running?
When an object is selected, the controller method "click" is
automatically
called. The default behavior is to select an object, but you may
override
this behavior by implementing your own click method in your controller
object.
Let's say you have an agent stored in the variable "unselectableAgent".
You could implement the click method as follows:
+ to click on agent (object):
if agent == unselectableAgent: return.
super click on agent.
Note the "super click on agent". That code is necessary if you want
selection to work as expected for the rest of the agents in the
simulation.
- jon klein
_______________________________________________
breve mailing list
[email protected]
http://lists.spiderland.org/mailman/listinfo/breve