However if the items are pinned horizontally or vertically they will disappear. You should check that.
And also you should check if the dw/cw*x is an exact number. If not it will mean that the desktop don’t have an exact number of cells.
I couldn’t resist myself to made it, and it is really the same! π however yours also move the items vertically, but mine checks all the things I mentioned.
What about blend both to have a powerful script? I can’t now (time to sleep) but I will try to do tomorrow…unless you want to π
var cont = LL.getEvent().getContainer();
var items=cont.getItems();
var dist=cont.getWidth();
var cellsFloat=dist/cont.getCellWidth();
var cells=Math.round(cellsFloat)
if(Math.abs(cellsFloat-cells)>0.00001)if(!confirm(“Warning, the cells don’t fill the screen as an exact number.\nDo you want to continue?”))return;
var move = parseInt(prompt(“Which page do you want to be the home one? ( left ones are negative)”,Math.round(cont.getPositionX()/dist)));
< ![CDATA[
Lighting Settings>All Settings>Configure Desktops>Select which one you want as home, click the little house at bottom.
]]>
< ![CDATA[
Menu/lightning settings/all settings/configure desktops.
Tap which desktop you want as home screen then press the house icon at the bottom of the screen.
]]>
< ![CDATA[
Well, LL have an infinite canvas, and change the home page will mean change the position of all items.
Maybe this can be a built-in feature in the future.
But now the only thing you can do is move all the items yourself…
…or, if you are using LLX I can make a simple script that will move them for you.
]]>
< ![CDATA[
I have already a script moving all items, i needed them for debugging some scripts.
I’ll post soon.
]]>
< ![CDATA[
Damaged Industries Jay M
When someone says ‘pages’ here in LL we understand he is talking about a ‘piece of the infinite canvas with the size of the screen’.
Silvia is asking how to change the home page in a desktop.
Your suggestions says how to change the home desktop
Don’t worry, I’m not complaining about you. Just teaching π
I understand this is a bit confusing, but Pierre wrote this in the wiki, and he can’t be wrong π
]]>
< ![CDATA[
Here is my script:
var d=LL.getEvent().getContainer();
var items=d.getItems();
var x=parseInt(prompt(“Value to go right (in pages) (use negative for left)”,0))||0;
var y=parseInt(prompt(“Value to go down (in pages) (use negative for up)”,0))||0;
if(x==0 && y==0)return;
var dw=d.getWidth();
var dh=d.getHeight();
var cw=d.getCellWidth();
var ch=d.getCellHeight();
for(a=0;a
{
var item=items.getAt(a);
if(item.getProperties().getBoolean(“i.onGrid”))
{
var cell=item.getCell();
item.setCell(cell.getLeft()+dw/cw*x,cell.getTop() +dh/ch*y,cell.getRight() +dw/cw*x,cell.getBottom()+dh/ch*y);
}
else
{
item.setPosition(item.getPositionX()+dw*x,item.getPositionY()+dh*y);
}
}
Remember: if you want to have the home page 1 left you have to move the items 1 right and so on.ο»Ώ
]]>
< ![CDATA[
Good one.
However if the items are pinned horizontally or vertically they will disappear. You should check that.
And also you should check if the dw/cw*x is an exact number. If not it will mean that the desktop don’t have an exact number of cells.
I couldn’t resist myself to made it, and it is really the same! π however yours also move the items vertically, but mine checks all the things I mentioned.
What about blend both to have a powerful script? I can’t now (time to sleep) but I will try to do tomorrow…unless you want to π
var cont = LL.getEvent().getContainer();
var items=cont.getItems();
var dist=cont.getWidth();
var cellsFloat=dist/cont.getCellWidth();
var cells=Math.round(cellsFloat)
if(Math.abs(cellsFloat-cells)>0.00001)if(!confirm(“Warning, the cells don’t fill the screen as an exact number.\nDo you want to continue?”))return;
var move = parseInt(prompt(“Which page do you want to be the home one? ( left ones are negative)”,Math.round(cont.getPositionX()/dist)));
for(var i=items.getLength()-1;i>=0;–i){
var item=items.getAt(i);
var prop=item.getProperties()
if(prop.getString(“i.pinMode”)[0]==’X’)continue;
if(prop.getBoolean(“i.onGrid”)){
var cell=item.getCell();
item.setCell(cell.getLeft()-cells*move,cell.getTop(),cell.getRight()-cells*move,cell.getBottom());
}else{
item.setPosition(item.getPositionX()-dist*move,item.getPositionY());
}
}
cont.setPosition(cont.getPositionX()-move*dist,cont.getPositionY(),cont.getPositionScale(),false);
]]>
< ![CDATA[
You have my permission to improve or merge whatever you want π
]]>
< ![CDATA[
Thanks guys! And thanks Triangulo for catching what I meant by page. π (Lol, triangle!)
]]>
< ![CDATA[
Second question. Where exactly do I insert this script?
]]>
< ![CDATA[
Oh, yes.
Copy paste the script as a new one (I already said the pros/cons of each one until I finally merge both)
Check the ‘appear in lightning menu’
In the desktop: long click, scripts, [this]
]]>
< ![CDATA[
My bad π
]]>
< ![CDATA[
Thaks!
]]>