Wednesday, December 9, 2009

12-8-09

I'm working with creating Morphs now. One thing I was pleased to find was how simple the syntax for adding keyboard and mouse input was. For the object to change color based on what it was clicked on is as simple as including a method of
mouseDown: anEvent
anEvent redButtonPressed
ifTrue: [self color: Color red].
anEvent yellowButtonPressed
ifTrue: [self color: Color yellow].
self changed

which checks if the mouse is over morph and if either the red mouse button (left click) or the yellow mouse button (wheel click) are pressed.

I ended the period trying to get croquet to work properly. Its an interesting software but I do prefer 3d modeling over 2d (im not sure of croquets 3d modeling capabilities).

1 comment:

  1. Clear signs of a really well designed system! It is pretty amazing when you think about it, but this was the first Graphical User Interface (GUI) written in the first Object Oriented Programming language. It doesn't surprise me that interacting with the graphical environment from within the programming language is simple. That is, after all, what the system was designed to to. Let's thank Alan Kay for being the genius that he is.

    btw. This might be a good time to take 10 minutes to read about Alan Kay: http://en.wikipedia.org/wiki/Alan_Kay

    ReplyDelete