On 22 Mar 2001 17:06:24 -0700 J Scott Jaderholm scott@jaderholm.com wrote:
How do I create "commands" for Etoys? That is, the things with yellow buttons with exclamation points in them (not scripts, which afaik are made up of commands).
Scott,
I assume you are referring to the phrases in the viewer (like "foo forward by 5") even though scripts do have the yellow exclamation as well. The answer is that today it's a bit on the difficult side, but coming soon will be some changes that make it easy (opening up all of Smalltalk, e.g.). Hang in there a little longer.
Cheers, Bob
Bob Arning arning@charm.net writes:
I assume you are referring to the phrases in the viewer (like "foo forward by 5") even though scripts do have the yellow exclamation as well. The answer is that today it's a bit on the difficult side, but coming soon will be some changes that make it easy (opening up all of Smalltalk, e.g.). Hang in there a little longer.
Bob,
Ok, there must be a way to do this then without creating my own commands, but I don't know how.
I have three SketchMorphs named Moon, Earth, and Sun. I want the Moon to revolve around the Earth, and the Earth to revolve around Sun.
I was going to make a command that would change the moon's X,Y based on the Earth's X,Y, but if I can't create commands that's not really an option.
I guess there's a better way to do this using the commands we already have..any ideas what that way is?
Btw, I call these commands since the tooltip says "Run this command once" and they appear to be different from scripts. Is there a better name?
Sincerely, jsj
J Scott Jaderholm scott@jaderholm.com wrote:
Ok, there must be a way to do this then without creating my own commands, but I don't know how.
I have three SketchMorphs named Moon, Earth, and Sun. I want the Moon to revolve around the Earth, and the Earth to revolve around Sun.
I was going to make a command that would change the moon's X,Y based on the Earth's X,Y, but if I can't create commands that's not really an option.
I guess there's a better way to do this using the commands we already have..any ideas what that way is?
Do you know about arithmetic in EToys? Click the little green arrow pointing to the right, and you can adjust a value using basic arithmetic. So you can do things like:
Moon's x <- Earth's x + Moon's deltaX
-Lex
squeak-dev@lists.squeakfoundation.org