now browsing by category

 

Having a productive weekend :D

Having a productive weekend 😀

Here’s something I had in my mind for some time.

Enables 8 instead of 4 gestures.

needs infinte scrolling and diagonal scrolling.

script in first comment for easy copying.

Thanks to TrianguloY, I stole your sessiontoken 😛

]]>

Animation: Card Style

Animation: Card Style

This requires the latest Beta to run smooth.

ATM not working with pre-scaled items.

http://www.pierrox.net/android/applications/lightning_launcher/wiki/doku.php?id=script_animation_cardstyle

]]>

Animation Turn: first animation with optional fade by me.

Animation Turn: first animation with optional fade by me.

Also I made it standalone.

http://www.pierrox.net/android/applications/lightning_launcher/wiki/doku.php?id=script_animation_turn

http://www.pierrox.net/android/applications/lightning_launcher/wiki/doku.php?id=script_animation_turn
]]>

Animation: Turn

Animation: Turn

See yourself.

Thanks to TrianguloY. You probably don’t know what exactly you did :D. most of it is giving me ideas, especially for pre-rotated items i’ve looked up a lot in your scripts…

This script should work with rotated items.

Theoretically it works also with scaled items, but the toggle script doesn’t include scale yet, so this is something you can expect soon.

http://www.pierrox.net/android/applications/lightning_launcher/wiki/doku.php?id=script_animation_turn

]]>

Save layout

Save layout

So, I’m fully back again…and with a new script!

This is something I started time ago, and I have been improving it adding rotation, custom velocity, and more. Now it’s time to publish it, but of course you can suggest improvements.

This script is something visually beautiful, perhaps a bit slow with too much items, but even I am impress with the final result. It saves the position, size, scale and rotation of the items in free mode, and restore them when launched moving them smoothly (more or less).

I’m good at scripting, but no so good at creating layouts. If you are one of the masters that creates awesome layouts I let you create one with this script, that would be awesome.

It is more than just some lines of code, so I wrote a description after the config. If you want to share a layout with the script the only thing I ask you is to leave those comments. You can modify it if you want (and know).

Instructions:

The script will save the data of the items in the tag of the item/container.

How to move the items: just launch the script from the item with the data (click, swipe…) or even from a container (tap, long tap…)

How to save the data: Launch the script from the scripts menu (LL pop-up –> scripts) and choose the velocity (the first time you can simply just executing normally).

Characteristics:

If the item have a different tag it will ask before save.

Items in grid mode won’t be saved, and also won’t be moved even if they were saved while in free mode.

Rotation works from the center of the item (something obvious, but not script-side)

Debug mode to see if an item is stuck in the animation.

When the launcher lost focus, items are automatically moved to the final position and the script finishes.

If you start a different instance of the script while another one is running, the previous one stops automatically.

Problems:

Items with skew can behave wrong.

———————-

The script is in the first comment. Just click it and copy all.

Tell me if you prefer this way.

]]>

I was a little bit dissatisfied how current selection effects are limited, so I made my own one.

I was a little bit dissatisfied how current selection effects are limited, so I made my own one.

The basic idea was to make specific items animate and behave as the the touch effect.

There are some problems, for example the animation needs to be played entirely to the end before launching the item, because in that moment the animation / script stops, and it will be frozen all until the launched application appears. (Somewhat visible on the video, due to the timing not being exact)

In this example video I used two items, which are rotating and scaling when an item is touched. They need to be made by hand, and they need to be off grid.

The items used for the effect are specified at the end of the script. You can use any number of them, modify the script to your needs. Change parameters, etc.

You will want to set the script to the click action of (app) shortcuts. Also it works even when called from other scripts, in this case the caller item (which around you want the effect to appear) needs to be passed by putting it into “self.i” (I don’t know whether there is a better solution than this for passing objects between scripts)

Script is here: http://pastie.org/9335805

]]>

First preview: new Animation, this time it’s all about Rotation ;)

First preview: new Animation, this time it’s all about Rotation 😉

+Pierre Hébert We need to set floats as angles via script! It’s not smooth with integers. 

]]>

gotoHpage and gotoVPage

gotoHpage and gotoVPage

Scrolling to pages within a container (e.g. Desktop)

Quick&Dirty Scripts i made cause of this:

https://plus.google.com/u/0/+gerdreuter/posts/cJhWmwo7GnS

use it like this:

LL.runScript(‘gotoHpage’,’-1′)

scrolls to the 1st page left from “homepage”

LL.runScript(‘gotoVpage’,2′)

scrolls to the 2nd  page underneath from “homepage”.

The Scripts:

————————————————————————————–

// gotoHpage

// scroll to horizontal Page 

// parameter is page relative to Homepage (0)

// leave vertical position as it is.

var gotoPage=LL.getEvent().getData();

var cont=LL. getEvent(). getContainer() ;

var width=cont.getWidth(); // ContainerWidth

var height=cont.getHeight(); // ContainerHeight

var pX=cont. getPositionX(); // Position X Left

var pY=cont. getPositionY(); // Position Y Top

cont.setPosition(gotoPage*width, pY);

————————————————————————————–

// gotoVpage(page)

// scroll to Vertical Page 

// parameter is page relative to Homepage (0)

// leave horizontal position as it is.

var gotoPage=LL.getEvent().getData();

var cont=LL. getEvent(). getContainer() ;

var width=cont.getWidth(); // ContainerWidth

var height=cont.getHeight(); // ContainerHeight

var pX=cont. getPositionX(); // Position X Left

var pY=cont. getPositionY(); // Position Y Top

cont.setPosition(pX,gotoPage*height);

https://plus.google.com/u/0/+gerdreuter/posts/cJhWmwo7GnS
]]>

Helllo

Helllo,

how can I get an `id` of shortcut which I placed on my desktop?

I want to launch that shortcut via scripting API like this:

`LL.getItemById(id).launch();`

…but I don’t know an `id`.

Thanks for answers 🙂

]]>

Challenge

Challenge

Let’s wake up a bit this community with a challenge open to everyone (no prize sorry). This is a mathematical challenge to make a script, however you can also try if you don’t know scripting, just tell the steps or write the formulas.

This task is something I’ve been thinking for a lot myself, but I couldn’t get the right answer until now. This is the challenge in case you want to try, not very difficult, easy when you find the answer, but really tricky specially if you take the wrong way (and I took a lot of wrong ways 😛 )

As you probably know, you can get geometry data from items: size, scale, (skew), rotation and position.

However the position you get is the one of the top left corner of the minimum box surrounding it.

What if you want to know the center of the object?

(Note: let’s assume skewX=skewY=0 to avoid that strange parameter)

Task: Write a function with:

Input: an item (or their geometry data as said before)

Output: a vector [x,y] with the position of the center of the object.

You can use the Math functions (cos, sin, tan, acos, asin, atan, abs, sqrt, pow, … )

The video shows how it should behave in action. The cross item is the input, the circle is the output.

(About the ending part: all questions will be answered at the end of the month)

Submit your answers here in comments. You won’t win anything sorry, just the fact of solving this tricky challenge 🙂 I’ll publish my own solution when necessary, I expect to do it in one week or less. I want first to see others.

Also, keep in mind that this is really useful, it doesn’t only tell you the center, also the size of the whole item. Perhaps in the future Pierre will be able to implement the getBoundingBox in items, but from now we have this.

If you found this too easy, this is an extra variation (that I personally couldn’t resolve, so I can’t provide the right answer): modify it to work with skew too.

]]>