I love it now
can we use it for a real clock? I mean do we get the warrantie that 1 min is 1 min?
BTW we will have to write a nice animation chapter!
So continue to explain on the list like that we will have material :)

Stef

On Sun, Nov 26, 2017 at 2:29 AM, Aliaksei Syrel <alex.syrel@gmail.com> wrote:
Hi Sean,
��
How would one do e.g. a ticking clock in Bloc?

I pushed a clock example to the #master branch (BlClockExample clock)��

Stepping mechanism can be implemented using infinite animation (stepping is nothing else than a special case of animation).
Below is a definition of animation used to rotate second hand by 6 degrees every second.

BlNumberTransition new
�� onStepDo: [ :aSecond |
�� �� secondHand transformDo: [ :aTransform |
�� �� �� aTransform rotateBy: aSecond * self minuteRotationDelta - 90 ] ];
�� from: 0;
�� to: 60;
�� by: 1;
�� duration: 1 minute

The code above says that we should do a number transition from 0 to 60 by 1 (0,1,2,3,4,5,6,7...60) during 1 minute.
On every step we rotate our second hand by appropriate angle in degrees. -90 is needed because clock hands start from Pi/2 radians on a unit circle.

In the end we get the following animation:

Inline images 1


P.S. In attachment I also send a high quality video.

Cheers,
Alex

On 25 November 2017 at 23:58, Sean P. DeNigris <sean@clipperadams.com> wrote:
Bump :)


Sean P. DeNigris wrote
>> How would one do e.g. a ticking clock in Bloc? The only possibly relevant
>> example I see is BlAnimatedCursor. Is that a typical usage? One thing
>> that
>> I'm not sure how to translate to a BlElement is that the cursor seems to
>> be
>> responsible for starting and stopping the animation via #activateOn:,
>> which
>> doesn't exist for an element. How would one prevent an element's
>> animation
>> from continuing to run after a space was closed?��� I guess I mean what is
>> the
>> Bloc version of #step that would enable us to do e.g. Squeak's
>> mouse-eyes-tracking-the-cursor or Lively Kernel's clock:
>> https://upload.wikimedia.org/wikipedia/commons/5/5e/Chromium5.0.375.99_showing_lively_kernel_using_gtk%2B_theme.png