Aqua-Soft Forums: [Help] XML and blank layers - Aqua-Soft Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

[Help] XML and blank layers Rate Topic: -----

#1 User is offline   kerin Icon

  • Group: Member
  • Posts: 406
  • Joined: 22-October 03

Posted 20 November 2005 - 07:10 PM

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="full%SUN%.png" x="0" y="0" width="291" height="186" alpha="100" />
   <layer name="day0" src="!XMLSRC:['small/'][//dayf/day[@d=0]/part[@p='n']/icon]" x="22" y="78" />
		 ... 
<layer name="cityname" src="!XMLTRANSTXT:[substring-before(//loc/dnam,',')]" 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="!XMLTXT:1[//cc/tmp]['°']" x="180" y="7" fontsize="38" fontname="Lucida Sans Unicode" fontstyle="B" alpha="255" fontcolor="clwhite" width="100" height="50" fontalign="R"/>
   <layer src="grid" x="15" y="60"/>
</layer>


Thanks for this excelent script interpretter :)
0

#2 User is offline   AndreasV Icon

  • Group: Developers
  • Posts: 2,137
  • Joined: 22-November 03

Posted 20 November 2005 - 07:18 PM

add fullhittest="yes" to the layer.

btw, Hi!, long time ago
0

#3 User is offline   pcm Icon

  • Group: Member
  • Posts: 617
  • Joined: 02-May 05

Posted 20 November 2005 - 09:55 PM

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="!BLANKSPACE"), 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.
0

#4 User is offline   pcm Icon

  • Group: Member
  • Posts: 617
  • Joined: 02-May 05

Posted 20 November 2005 - 10:16 PM

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
0

#5 User is offline   kerin Icon

  • Group: Member
  • Posts: 406
  • Joined: 22-October 03

Posted 25 November 2005 - 06:19 AM

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 ;)
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic