Fading elements

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

Fading elements

abergel
Hi!

Just to share a small addon to manage alpha blending I made with Roassal. 

Try in an easel the following:

-=-=-=-=-=-=-=-=-=-=-=-=
random := Random new.
view shape circle size: 80; fillColor: Color black. 
view interaction on: ROMouseEnter do: [ :event |
ROColorAlphaFading new for: event element nbCycles: 60 ].
nodes := view nodes: (1 to: 50). 
nodes do: [:el | el translateTo: (random next * 400) @ (random next * 400) ].
view noLayout.

ROPluggableAnimation new
nbCycles: 20000;
block: [ ROColorAlphaFading new for: nodes atRandom nbCycles: 60 ];
on: view raw.
-=-=-=-=-=-=-=-=-=-=-=-=

-=-=-=-=-=-=-=-=-=-=-=-=
view shape circle size: 80; fillColor: Color black. 
view interaction on: ROMouseEnter do: [ :event |
ROColorAlphaFading new for: event element nbCycles: 60 ].
view nodes: (1 to: 50).
view gridLayout.
-=-=-=-=-=-=-=-=-=-=-=-=


It also works with edges:
-=-=-=-=-=-=-=-=-=-=-=-=
view interaction 
dynamicEdgeToAll: [ :model | (1 to: model) collect: [ :v | v // 2 ] ]
usingFading: (ROLine red width: 5; attachPoint: ROCenteredAttachPoint instance).

view shape rectangle size: 20.
view nodes: (1 to: 20).
 
view circleLayout.
-=-=-=-=-=-=-=-=-=-=-=-=

In the last version of Roassal

Cheers,
Alexandre

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




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

Re: Fading elements

stephane ducasse
cool consider copy and paste the mail in the roassal chapter.

Stef

On May 18, 2013, at 12:37 AM, Alexandre Bergel <[hidden email]> wrote:

Hi!

Just to share a small addon to manage alpha blending I made with Roassal. 

Try in an easel the following:

-=-=-=-=-=-=-=-=-=-=-=-=
random := Random new.
view shape circle size: 80; fillColor: Color black. 
view interaction on: ROMouseEnter do: [ :event |
ROColorAlphaFading new for: event element nbCycles: 60 ].
nodes := view nodes: (1 to: 50). 
nodes do: [:el | el translateTo: (random next * 400) @ (random next * 400) ].
view noLayout.

ROPluggableAnimation new
nbCycles: 20000;
block: [ ROColorAlphaFading new for: nodes atRandom nbCycles: 60 ];
on: view raw.
-=-=-=-=-=-=-=-=-=-=-=-=
<Screen Shot 2013-05-17 at 6.33.24 PM.png>

-=-=-=-=-=-=-=-=-=-=-=-=
view shape circle size: 80; fillColor: Color black. 
view interaction on: ROMouseEnter do: [ :event |
ROColorAlphaFading new for: event element nbCycles: 60 ].
view nodes: (1 to: 50).
view gridLayout.
-=-=-=-=-=-=-=-=-=-=-=-=


It also works with edges:
-=-=-=-=-=-=-=-=-=-=-=-=
view interaction 
dynamicEdgeToAll: [ :model | (1 to: model) collect: [ :v | v // 2 ] ]
usingFading: (ROLine red width: 5; attachPoint: ROCenteredAttachPoint instance).

view shape rectangle size: 20.
view nodes: (1 to: 20).
 
view circleLayout.
-=-=-=-=-=-=-=-=-=-=-=-=

In the last version of Roassal

Cheers,
Alexandre

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



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


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

Re: Fading elements

Tudor Girba-2
In reply to this post by abergel
Nice.

However, the last example does not work quite well:
- first the edges appear red
- then they disappear
- and only then it starts fading from white to red

Doru

On May 18, 2013, at 12:37 AM, Alexandre Bergel <[hidden email]> wrote:

> Hi!
>
> Just to share a small addon to manage alpha blending I made with Roassal.
>
> Try in an easel the following:
>
> -=-=-=-=-=-=-=-=-=-=-=-=
> random := Random new.
> view shape circle size: 80; fillColor: Color black.
> view interaction on: ROMouseEnter do: [ :event |
> ROColorAlphaFading new for: event element nbCycles: 60 ].
> nodes := view nodes: (1 to: 50).
> nodes do: [:el | el translateTo: (random next * 400) @ (random next * 400) ].
> view noLayout.
>
> ROPluggableAnimation new
> nbCycles: 20000;
> block: [ ROColorAlphaFading new for: nodes atRandom nbCycles: 60 ];
> on: view raw.
> -=-=-=-=-=-=-=-=-=-=-=-=
> <Screen Shot 2013-05-17 at 6.33.24 PM.png>
>
> -=-=-=-=-=-=-=-=-=-=-=-=
> view shape circle size: 80; fillColor: Color black.
> view interaction on: ROMouseEnter do: [ :event |
> ROColorAlphaFading new for: event element nbCycles: 60 ].
> view nodes: (1 to: 50).
> view gridLayout.
> -=-=-=-=-=-=-=-=-=-=-=-=
>
>
> It also works with edges:
> -=-=-=-=-=-=-=-=-=-=-=-=
> view interaction
> dynamicEdgeToAll: [ :model | (1 to: model) collect: [ :v | v // 2 ] ]
> usingFading: (ROLine red width: 5; attachPoint: ROCenteredAttachPoint instance).
>
> view shape rectangle size: 20.
> view nodes: (1 to: 20).
>
> view circleLayout.
> -=-=-=-=-=-=-=-=-=-=-=-=
>
> In the last version of Roassal
>
> Cheers,
> Alexandre
>
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
www.tudorgirba.com

"Reasonable is what we are accustomed with."


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

Re: Fading elements

abergel
Hi!

The last version of Roassal should fix this.

Alexandre


On May 19, 2013, at 12:40 PM, Tudor Girba <[hidden email]> wrote:

> Nice.
>
> However, the last example does not work quite well:
> - first the edges appear red
> - then they disappear
> - and only then it starts fading from white to red
>
> Doru
>
> On May 18, 2013, at 12:37 AM, Alexandre Bergel <[hidden email]> wrote:
>
>> Hi!
>>
>> Just to share a small addon to manage alpha blending I made with Roassal.
>>
>> Try in an easel the following:
>>
>> -=-=-=-=-=-=-=-=-=-=-=-=
>> random := Random new.
>> view shape circle size: 80; fillColor: Color black.
>> view interaction on: ROMouseEnter do: [ :event |
>> ROColorAlphaFading new for: event element nbCycles: 60 ].
>> nodes := view nodes: (1 to: 50).
>> nodes do: [:el | el translateTo: (random next * 400) @ (random next * 400) ].
>> view noLayout.
>>
>> ROPluggableAnimation new
>> nbCycles: 20000;
>> block: [ ROColorAlphaFading new for: nodes atRandom nbCycles: 60 ];
>> on: view raw.
>> -=-=-=-=-=-=-=-=-=-=-=-=
>> <Screen Shot 2013-05-17 at 6.33.24 PM.png>
>>
>> -=-=-=-=-=-=-=-=-=-=-=-=
>> view shape circle size: 80; fillColor: Color black.
>> view interaction on: ROMouseEnter do: [ :event |
>> ROColorAlphaFading new for: event element nbCycles: 60 ].
>> view nodes: (1 to: 50).
>> view gridLayout.
>> -=-=-=-=-=-=-=-=-=-=-=-=
>>
>>
>> It also works with edges:
>> -=-=-=-=-=-=-=-=-=-=-=-=
>> view interaction
>> dynamicEdgeToAll: [ :model | (1 to: model) collect: [ :v | v // 2 ] ]
>> usingFading: (ROLine red width: 5; attachPoint: ROCenteredAttachPoint instance).
>>
>> view shape rectangle size: 20.
>> view nodes: (1 to: 20).
>>
>> view circleLayout.
>> -=-=-=-=-=-=-=-=-=-=-=-=
>>
>> In the last version of Roassal
>>
>> Cheers,
>> Alexandre
>>
>> --
>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>> Alexandre Bergel  http://www.bergel.eu
>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>
>>
>>
>> _______________________________________________
>> Moose-dev mailing list
>> [hidden email]
>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
> --
> www.tudorgirba.com
>
> "Reasonable is what we are accustomed with."
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

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




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