Roassal Tip #6: How to animate elements and layout?

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

Roassal Tip #6: How to animate elements and layout?

abergel
Layout may be applied at each refresh using the class RTLayoutAnimation. This is useful when elements have varying size.

-=-=-=-=-=-=-=-=-=-=-=-=
| v es resizeAnimation shape normalizer |
v := RTView new.
normalizer := RTMultiLinearColor new.
shape := RTBox new size: ‪#‎yourself‬; color: [ :value | (normalizer level: (value / 100)) alpha: 0.4 ].
es := shape elementsOn: (1 to: 100 by: 10).
v addAll: es.
v canvas addMenu: 'Press me!' callback: [
es do: [ :e |
resizeAnimation :=
RTResizeMove new
toExtent: (100 - e model) @ (100 - e model) on: e.
e model: (100 - e model).
v addAnimation: resizeAnimation ] ].
v addAnimation: (RTLayoutAnimation new elements: es; yourself).
v open
-=-=-=-=-=-=-=-=-=-=-=-=

Animation on:
https://www.facebook.com/photo.php?v=636496456436955&set=vb.340543479365589&type=2&theater

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




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