View Full Version : Copying Objects
crazychimp132
10-01-2005, 09:37 PM
Is there a method that makes a copy of an object? I can't find anything on this, but I think it would be useful.
I'm not sure I fully understand what you're asking. Are you asking how to make a copy of an object without having to drag it in from the gallery twice? If so, you can do this by:
1. Open the "add objects" screen
2. Click the copy objects button, located in the upper right corner of the screen in the cluster of buttons that have faces on them. It's the last one.
3. Click the object you wish to copy and drag it to another location. Make sure to re-select the arrow or other option afterwards, so when you click on it again, you don't make another copy inadvertently.
If you are asking how to write a method that duplicates an object, I don't believe it is possible. What you can do is make multiple objects and make them invisible by default, and then make it appear as though the original is duplicating by making the copies visible again. You can find this option under the object properties. The tile is named "isShowing" and is set to true by default.
crazychimp132
10-03-2005, 03:27 PM
I meant the latter, a method that copies an object so it can happen while the world is running. I do think it would be useful to have this feature. I'll give a very basic example- a world in which there is a gardener who plants flowers at random- each time a flower is planted, a copy of the flower object is made and placed. Without a copy method, the programmer would never be able to add enough flowers to the world mannually, since the world can run forever. Also, it would be much less tedious to make copies as they were needed than making one flower after another visible.
On the other hand, I do understand why having the ability to make copies could be confusing- how does Alice display objects that have not been created yet, and may never be, on the objects list?
OK, I understand what you're saying now. I can see several problems with implementing the ability to add an object from within a method (and no doubt our programmer will have much more to say ;-)).
If you think this feature would be useful to have, please post your suggestion in the Suggestion Box subforum so we can have a nice consolidation of ideas for which to go to when adding functionality. I do think this is a good idea.