Fading out a morph

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

Fading out a morph

patrick dudjalija
Hello everyone !
 
I found a way to fade out a morph via the BitBlt class.
Problem is with the code line "(Duration seconds:1) asDelay wait."
When this line is present, i don't see the intermediary states, only the final result.
But i need wait time at each iteration of BitBlt copyBits, precisely to visualize the fading out ...
 
see code below.
 
Thank you very much for any help ...
 
Patrick
 
 
|s|

s:=SketchMorph fromStream: (FileStream readOnlyFileNamed:'.\images\LesPetitesBetes\abeille.png').

s openInWorld.

s center:Display center.

1 to: 10 do: [:el|

(Duration seconds:1) asDelay wait.

(BitBlt
destForm: s form
sourceForm: nil
halftoneForm: ((Color white) alpha:0.2)
combinationRule:24
destOrigin:0@0
sourceOrigin:0@0
extent:(s extent)
clipRect: (([hidden email]) extent: (s extent)) ) copyBits.

].


_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Fading out a morph

Tobias Pape
Am 19.07.2012 um 15:23 schrieb patrick dudjalija:

> Hello everyone !
>  
> I found a way to fade out a morph via the BitBlt class.
> Problem is with the code line "(Duration seconds:1) asDelay wait."
> When this line is present, i don't see the intermediary states, only the final result.
> But i need wait time at each iteration of BitBlt copyBits, precisely to visualize the fading out ...
>  
> see code below.

this should probably done in the stepping of the morph.

>  
> Thank you very much for any help ...

>  
> Patrick
>  
>  
> |s|
> s:=SketchMorph fromStream: (FileStream readOnlyFileNamed:'.\images\LesPetitesBetes\abeille.png').
>
> s openInWorld.
>
> s center:Display center.
>
> 1 to: 10 do: [:el|
>
> (Duration seconds:1) asDelay wait.
>
> (BitBlt
> destForm: s form
> sourceForm: nil
> halftoneForm: ((Color white) alpha:0.2)
> combinationRule:24
> destOrigin:0@0
> sourceOrigin:0@0
> extent:(s extent)
> clipRect: ((0@0) extent: (s extent)) ) copyBits.
>
> ].

You probably want to check out the animations Package of
Marcel:

https://www.hpi.uni-potsdam.de/hirschfeld/trac/SqueakCommunityProjects/wiki/animations


Best
        -Tobias_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners