====== Differences ====== This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
script_sidebar_anim [2014/04/02 13:31] tbog [How to use the script] |
script_sidebar_anim [2014/05/03 20:33] (current) tbog [About the script] |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== About the script ====== | ====== About the script ====== | ||
* Purpose : Animate panels to look like the Reddit app menu animation | * Purpose : Animate panels to look like the Reddit app menu animation | ||
- | * Author : TBog | + | * Author : [[http://www.google.com/+BogdanTautuTBog|TBog]] |
- | * Link: http://www.google.com/+BogdanTautuTBog | + | * Link: [[https://plus.google.com/113849548683946155652/posts/b7kH4ryEkvH|requested post]] |
====== How to use the script ====== | ====== How to use the script ====== | ||
Line 10: | Line 10: | ||
* Left and right panels must not be on grid but must have the width of the screen minus one cell | * Left and right panels must not be on grid but must have the width of the screen minus one cell | ||
+ | * Center panel must be on top and have a opaque background to hide the other two panels | ||
* Stop points should have the following options set: | * Stop points should have the following options set: | ||
- | - left stop point | + | - left stop point |
- | * Behavior: Barrier, Snapping | + | * Behavior: Barrier, Snapping |
- | * Direction: Left to right, Right to left | + | * Direction: Left to right, Right to left |
- | * Match edges: Left | + | * Match edges: Left |
- | - center stop point | + | - center stop point |
- | * Behavior: Stop scroll, Stop drag, Snapping | + | * Behavior: Stop scroll, Stop drag, Snapping |
- | * Direction: Left to right, Right to left | + | * Direction: Left to right, Right to left |
- | * Match edges: Left | + | * Match edges: Left |
- | - right stop point | + | - right stop point |
- | * Behavior: Barrier, Snapping | + | * Behavior: Barrier, Snapping |
- | * Direction: Left to right, Right to left | + | * Direction: Left to right, Right to left |
- | * Match edges: Left | + | * Match edges: Left |
+ | * Set the script on the Position changed event of the desktop | ||
+ | **Important!** | ||
+ | Replace 0x40004 and 0x40005 from the script with the ids of your panels. | ||
====== Script code ====== | ====== Script code ====== | ||
<code> | <code> | ||
Line 36: | Line 40: | ||
var ww = w-cell; | var ww = w-cell; | ||
var x = c.getPositionX()/ww; | var x = c.getPositionX()/ww; | ||
+ | ww = ww/2; | ||
if (x <= 0) | if (x <= 0) | ||
- | pLeft.setPosition(-ww/2 + x*ww/2, pLeft.getPositionY()); | + | pLeft.setPosition(-ww + x*ww, pLeft.getPositionY()); |
if (x >= 0) | if (x >= 0) | ||
- | pRight.setPosition(cell + ww/2 + x*ww/2, pRight.getPositionY()); | + | pRight.setPosition(cell + ww + x*ww, pRight.getPositionY()); |
</code> | </code> |