[Help] XML and blank layers

Hi all,

I was looking for customising the weather script to add fade-in and out effect on the background.

My problem is that I added some effects but.... the background is set up in the "root" layer so if I put an effect on this layer, the effect will also apply on the sub layers.

I just want to apply the effect on the background and not on the sublayers.

here is what I made for the layers:

Root layer (blank) with effect call: onmouseenter="!EFFECT:SHOW,background_layer,255,10,10" onmouseexit="!EFFECT:HIDE,background_layer,100"

- Bacground layer

- low temp layer

- hi temp layer

- ...

The problem is that a blank layer doen't give me onmouseenter and exit event (because it's blank of course....)

How can I resolve this issue?? I tried to put a transparent PNG as background but it doesnt change...

This is my code:

<layer name="fullbg" x="36" y="48" width="291" height="186" alpha="255" visible="%FULLMODE%" scale="no" onmouseenter="!EFFECT:SHOW,background_full,255,10,10" onmouseexit="!EFFECT:HIDE,background_full,100"/>
<layer name="background_full" src="../../unavailable.html" x="0" y="0" width="291" height="186" alpha="100" />
<layer name="day0" src="../../unavailable.html" x="22" y="78" />
...
<layer name="cityname" src="../../unavailable.html" x="125" y="30" fontsize="13" fontname="Lucida Sans Unicode" fontstyle="B" alpha="255" fontcolor="clwhite" width="100" height="20" fontalign="L"/>
<layer name="ccctmp" src="../../unavailable.html" x="180" y="7" fontsize="38" fontname="Lucida Sans Unicode" fontstyle="B" alpha="255" fontcolor="clwhite" width="100" height="50" fontalign="R"/>
<layer src="../../unavailable.html" x="15" y="60"/>
</layer>

Thanks for this excelent script interpretter :)

#332904

add fullhittest="yes" to the layer.

btw, Hi!, long time ago

#332909

Ya... a "Sub" layer isn't a real avedesk layer where the all act independent, when you creat sub, everything works together. Which allows things like sliding the entire layer and its sub as 1 thing. Subs also don't have events, or effects they are only there to draw something on a "real" layer.

Now to do what you want makes a lot of sense, but to do that I would have to add a couple of lines of code, so that you are allow modifing of the sublayers at runtime. Something that totally slipped my mind, very sorry.

The I've added to my list of TODO.

Since I'm in the middle of trying to fix a major "issue", if your not too much of a a hurry, I'll the ability for the next update. Schedule in a couple of weeks.

Mean time, The only other way to mimic what you want is to create another real layer and make that one blank. (src="../../unavailable.html"), then you could use the event to show or hide the other layer. But the sliding wouldn't work as is, you'd need to modify that too.

#332945

To create the effect you want you can do this..

In the XML change the layers to the following:

...

And now you need to modify the code too

function SlideDown(){

//Inital settings for slide

var smalllayer = this.layers.item('smallbg');

var fulllayer = this.layers.item('fullbg');

var fulllayerT = this.layers.item('fullbgT');

this.LockAllUpdates();

fulllayer.lockupdates();

fulllayer.src = 'full%SUN%.png';

fulllayer.visible = true;

...

//set final layer size

fulllayer.ClipSource = '0,0,291,186';

fulllayer.redraw();

smalllayer.visible = false;

fulllayerT.src = 'full%SUN%.png';

fulllayer.src = '!BLANKSPACE';

this.refresh();

...

}

function SlideUp(){

//Inital settings for slide

var smalllayer = this.layers.item('smallbg');

var fulllayer = this.layers.item('fullbg');

var fulllayerT = this.layers.item('fullbgT');

this.LockAllUpdates();

fulllayer.src = 'full%SUN%.png';

fulllayerT.src = '!BLANKSPACE';

smalllayer.lockupdates();

...

}

This will create mostly the effect you want, but I think you'll probably need to do this on the ONMouseEnter of the desklet, which sadly I didn't add effect support (Also added in the TODO)

If you got any questions, let me know

#332948

well thanks for it :)

I'll take a look closer this week end and tell you if I managed to do what I wanted to do.

Andreas: Hi! Yeah it's been a while but I was always check news about avedesk :) Love the 1.3 ;)

#334218