moving eye in squeak

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

moving eye in squeak

mnrao
i want to write code for moving eyes just like the eyes in squeak logo.can any one helps me please.
Reply | Threaded
Open this post in threaded view
|

Re: moving eye in squeak

Enno Schwass
Hallo

> i want to write code for moving eyes just like the eyes in squeak  
> logo.can
> any one helps me please.

I am a beginner too, but maybe I can help.

Open a class browser. do a <find>. Look for MovingEyeMorph
Check the protocol and the 6 instance methods. Dont forget the 2  
class methods.
Parent class is EllipseMorph. Look there too.

Open a workspace.

Type

MovingEyeMorph new openInWorld.

Do it.

Back to class browser. Change defaultColor method first. Accept your  
changes. See what happens if you create a new MovingEyeMorph in  
workspace.

Change IrisSize in class method inititialize. See again what happens.
Play around with the other methods. There is no book about morphic. Buy
A quick trip to objectland. This helps me a lot.

Hope it helps
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: moving eye in squeak

Herbert König
In reply to this post by mnrao
Hello,

m> i want to write code for moving eyes just like the eyes in squeak logo.can
m> any one helps me please.

sorry, your question is a bit unclear to me.

MovingEyeMorph is ready made for use and change.

So: The moving part of the moving eye is done in MovingEyeMorph>>step.
(read this as in a Browser find the class "MovingEyeMorph" and there
look at the step method.

The geometry is set up in the initialize method.

If you don't yet know what a Morph is, there's a lot of material on
the swiki  at http://wiki.squeak.org

I find Jim Benson's Article at http://wiki.squeak.org/1253 a pleasant
read for a start, even though it's a bit outdated.


regards

Herbert                            mailto:[hidden email]

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: moving eye in squeak

Scott Wallace-2
In reply to this post by mnrao
Hello,

A couple of the good replies you've already received instruct you to  
browse the "MovingEyeMorph" class.

But perhaps you are wondering how you could have discovered this on  
your own, so that the next time you're curious about how something  
works, you might not need to be told a magic class name by someone else.

So try this:  bring up the halo on a moving eye (alt-click on it)  
click on the "debug menu" halo handle (wrench icon, just below the  
green handle,) choose "browse class".  This will open a browser  
pointed at the class that implements the eyes; from this, you will  
learn that it is called MovingEyeMorph.

Of course, many things you see on the screen are complex, nested  
structures, and the code underlying them might be in more than one  
place.  But if you can actually see an object on the screen and want  
to start to investigate it, you can often get at the object's code  
quickly by interacting directly with the object via its halo in this  
manner.

Cheers,

  -- Scott

On Nov 15, 2006, at 8:57 PM, mnrao wrote:

>
> i want to write code for moving eyes just like the eyes in squeak  
> logo.can
> any one helps me please.
> --
> View this message in context: http://www.nabble.com/moving-eye-in- 
> squeak-tf2640841.html#a7371729
> Sent from the Squeak - Beginners mailing list archive at Nabble.com.
>
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/beginners

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners