cool animation using Viva...

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

cool animation using Viva...

abergel
Just insect that code :-)

-=-=-=-=-=-=-=-=-=
v := RTView new.
seconds := 7.
timer := TRVITimer new cycleLength: seconds.
rotationRatio := 0.2.
shape := RTRotatedLabel new.
shape
angleInDegree: [ :cls | 
| valueEnd |
valueEnd := cls numberOfMethods negated / rotationRatio.
TRVIAnimatedValue new
evaluator: [ :t | 0 interpolateTo: valueEnd at: t ];
timer: timer;
yourself ].
shape text: [ :cls | '                                                                                ' , cls name ].
shape color: (Color black alpha: 0.2).
v addAll: (shape elementsOn: Collection withAllSubclasses).
v canvas color: Color white.
v addAnimation: RTResetAllShape new.
timer start.
v
-=-=-=-=-=-=-=-=-=


Cheers,
Alexandre
-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: cool animation using Viva...

stepharo

Alexandre

I'm trying to understand the logic.

what is angleInDegree:

Do you know if only one TRVIAnimatedValue would work instead of creating one each

I would like to understand why TRVIAnimatedValue new is not stored somewhere.


Le 22/1/16 à 14:46, Alexandre Bergel a écrit :
Just insect that code :-)

-=-=-=-=-=-=-=-=-=
v := RTView new.
seconds := 7.
timer := TRVITimer new cycleLength: seconds.
rotationRatio := 0.2.
shape := RTRotatedLabel new.
shape
angleInDegree: [ :cls | 
| valueEnd |
valueEnd := cls numberOfMethods negated / rotationRatio.
TRVIAnimatedValue new
evaluator: [ :t | 0 interpolateTo: valueEnd at: t ];
timer: timer;
yourself ].
shape text: [ :cls | '                                                                                ' , cls name ].
shape color: (Color black alpha: 0.2).
v addAll: (shape elementsOn: Collection withAllSubclasses).
v canvas color: Color white.
v addAnimation: RTResetAllShape new.
timer start.
v
-=-=-=-=-=-=-=-=-=


Cheers,
Alexandre
-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.





_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: cool animation using Viva...

abergel
The method angleInDegree: is defined on RTRotatedLabel to specify the rotation angle. In that case, the rotation depends on the number of methods of a class.

> I would like to understand why TRVIAnimatedValue new is not stored somewhere.

You can. But in this example, each labels rotates at a different speed and a particular angle. This is why you have

Alexandre


> On Jul 8, 2016, at 12:09 PM, stepharo <[hidden email]> wrote:
>
> Alexandre
>
> I'm trying to understand the logic.
> what is angleInDegree:
>
> Do you know if only one TRVIAnimatedValue would work instead of creating one each
> I would like to understand why TRVIAnimatedValue new is not stored somewhere.
>
> Le 22/1/16 à 14:46, Alexandre Bergel a écrit :
>> Just insect that code :-)
>>
>> -=-=-=-=-=-=-=-=-=
>> v := RTView new.
>> seconds := 7.
>> timer := TRVITimer new cycleLength: seconds.
>> rotationRatio := 0.2.
>> shape := RTRotatedLabel new.
>> shape
>> angleInDegree: [ :cls |
>> | valueEnd |
>> valueEnd := cls numberOfMethods negated / rotationRatio.
>> TRVIAnimatedValue new
>> evaluator: [ :t | 0 interpolateTo: valueEnd at: t ];
>> timer: timer;
>> yourself ].
>> shape text: [ :cls | '                                                                                ' , cls name ].
>> shape color: (Color black alpha: 0.2).
>> v addAll: (shape elementsOn: Collection withAllSubclasses).
>> v canvas color: Color white.
>> v addAnimation: RTResetAllShape new.
>> timer start.
>> v
>> -=-=-=-=-=-=-=-=-=
>>
>> <Mail Attachment.png>
>>
>> Cheers,
>> Alexandre
>> --
>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>> Alexandre Bergel  http://www.bergel.eu
>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>
>>
>>
>>
>>
>> _______________________________________________
>> Moose-dev mailing list
>>
>> [hidden email]
>> https://www.list.inf.unibe.ch/listinfo/moose-dev
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.list.inf.unibe.ch/listinfo/moose-dev

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.



_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev