User Tools

Site Tools


script_always_there_bar

**This is an old revision of the document!** ----

A PCRE internal error occured. This might be caused by a faulty plugin

====== About the script ====== * Purpose : This is a script that place an item (in the video a panel) always on top of the screen. Scroll down the desktop to show it. Scroll up to hide. * Author : [[https://plus.google.com/u/1/105066926163073195690|TrianguloY]] * Link: https://plus.google.com/u/1/105066926163073195690/posts/DPufvGD2SjF ====== How to use the script ====== Instructions: * Copy paste this script as a new one. * IMPORTANT: you need to write the ID of the item you want to move (id, because panels don't have label) * Pin that item. * Set the script in the scroll event of the desktop ====== Script code ====== <code> var desk = LL.getCurrentDesktop(); /* Id of the item to move.*/ var bar = desk.getItemById(524308); /* current position // in case don't exist //difference //save */ var deskpos = desk.getPositionY(); if(!("prev" in self )) self.prev = deskpos; var d = deskpos-self.prev; self.prev = deskpos; var barpos = bar.getPositionY(); var size=bar.getScaleY() * bar.getHeight(); /*hide the bar */ if(d>0 && barpos>-size){ if(barpos-d<-size || barpos<-size){ bar.setPosition(0,-size); }else{ bar.setPosition(0,barpos-d); } } /*show the bar */ if(d<0 && barpos<0){ if(barpos-d*2>0 || barpos>0){ bar.setPosition(0,0); }else{ bar.setPosition(0,barpos-d*2); } } </code>

script_always_there_bar.1396290179.txt.gz · Last modified: 2014/03/31 18:22 by trianguloy