[General] Feedback: Morphs Need setOpacity method

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

[General] Feedback: Morphs Need setOpacity method

Philip Weaver
I don't normally use FF but I dug around in FireBug. I now understand that
every morph is already contained inside an SVG group. I suppose I just need
to hack something like this:
rawNode.style.setProperty('opacity', '0.2');

But I'm not entirely sure how to access the g node of each morph though
(this.node, this.rawNode, this.shape?) I'll keep playing - getting closer I
think.

Anyway, feedback: it would be nice if every Morph supported setOpacity to be
able to affect the opacity of each item in that group (including their
images).

Phil

On Wed, Feb 25, 2009@1:18 AM, Philip Weaver <[hidden email]> wrote:

> ImageMorphs do not appear to support opacity. However SVG groups do. How do
> I extend ImageMorph to nest lively.scene.Image inside an lively.scene.Group
> to allow image opacity? How do I use lively.scene.Group to affect the
> overall opacity of a set of child morphs?
> The goal is to perform animated transitions: click on an image and it fades
> to a Flickr/Google image results selector and then fades back.
>
> Thanks,
> Phil
>
> [edited]
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://livelykernel.sunlabs.com/pipermail/general/attachments/20090225/ffde239f/attachment.html 


Reply | Threaded
Open this post in threaded view
|

[General] Feedback: Morphs Need setOpacity method

Philip Weaver
That was pretty simple to hack. But Lively still may need
morph.setOpacity().
ImageMorph.subclass("enhanced.ImageMorph", {
 initialize: function($super, rectangle, imagePath) {
         $super(rectangle, imagePath);

this.rawNode.style.setProperty('opacity', '0.2');
this.setFillOpacity(0.0);
}
});
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://livelykernel.sunlabs.com/pipermail/general/attachments/20090225/7bf2f243/attachment.html 


Reply | Threaded
Open this post in threaded view
|

[General] Feedback: Morphs Need setOpacity method

Robert Krahn
Hi,

sorry I forgot to inform you. I already added the opacity setter/
getter to ImageMorph yesterday. You can now do stuff like:

x = new ImageMorph(new Rectangle(45, 45, 49, 49),  
URL.source.withFilename('mouse.png').toString());
x.openInWorld();
x.setOpacity(0.3)

Robert

On Feb 25, 2009,@2:15 PM, Philip Weaver wrote:

> That was pretty simple to hack. But Lively still may need  
> morph.setOpacity().
>
> ImageMorph.subclass("enhanced.ImageMorph", {
>
> initialize: function($super, rectangle, imagePath) {
>
>         $super(rectangle, imagePath);
>        
> this.rawNode.style.setProperty('opacity', '0.2');
> this.setFillOpacity(0.0);
> }
> });
>
> _______________________________________________
> General mailing list
> [hidden email]
> http://livelykernel.sunlabs.com/mailman/listinfo/general