Basic Morph question - updating
Stephan B. Wessels
swessels at cox.net
Sun Feb 6 00:34:42 UTC 2005
Günther,
The details tell the story.
Each Morph has control over this. If the Morph sub-class implements
the #step method then it will get updated at regular intervals.
The update interval is controlled by the #stepTime method. If that
same Morph wants to be updated at a non-default rate it would answer
the number of milliseconds between each step in the #stepTime method.
In some cases I've also seen Morphs that implement #wantsSteps to
answer false if they do not want to be updated. In this manner they
can still implement their own #stepTime and #step methods and then
control whether they are active or not by use of the #wantsSteps
method.
You could, with this technique, create a morph that has an idle and
active state. During the active state it would perform some kind of
animation or other action. Write the #wantsSteps method to answer true
when the morph is active and false when it is idle. Write the #step
method to make the incremental animation happen. Write the #stepTime
method to control how much time should elapse (in milliseconds) between
each "step". So when the #wantsStep says true, you move, and when it
says false you sit idle.
I used way too many words. I hope that helps.
Cheers,
- Steve
On Feb 5, 2005, at 4:29 PM, Guenther Schmidt wrote:
> Hi,
>
> I've got a basic morph question.
>
> Did I understand it right, that a Morph (for instance the inspector)
> is updating itself by polling its model on a regular interval (500
> ms)?
>
> Günther
>
>
>
--
"Nobody can make you feel inferior without your permission."
Eleanor Roosevelt
More information about the Squeak-dev
mailing list
|