You are not logged in.

Announcement

Forum database was corrupt and an old backup was restored as temporary replacement. Registrations closed until the database is recovered. Please ask questions using the Contact form

#1 12-02-2014 17:10:15

steebchen
Contributors
From: Germany
Registered: 03-05-2013
Posts: 121

Custom tilesize (in px)

Hello,
is it possible to have a custom tilesize which can I declare with pixels?

Offline

#2 12-02-2014 22:05:34

chrismaliszewski
Contributors
From: Torun, Poland
Registered: 06-05-2013
Posts: 246
Website

Re: Custom tilesize (in px)

Yes it is possible but requires some changes in code.

1st of all you need to change values of $scale and $spacing in config/layout.php which determine $scaleSpacing in inc/tilefunctions.php which is used during generation of code for tiles e.g. $tileWidth. But I haven't checked how it behaves and what values you should set (I think $scale = 0, $spacing = 10).

2nd thing is to change equations of calculating $marginTop, $marginLeft, $tileWidth and $tileHeight for all types of tiles which should be:
$marginTop = $y*$height+getMarginTop($group);
$marginLeft = $x*$width+getMarginLeft($group);
$tileWidth = $width-$spacing;
$tileHeight = $height-$spacing;

Read my next comment.

I don't guarantee that it works.

Last edited by chrismaliszewski (13-02-2014 09:11:37)

Offline

#3 13-02-2014 01:41:15

Thomas
Administrator
Registered: 10-03-2013
Posts: 897

Re: Custom tilesize (in px)

I think it's gonna mess up some tiles.

You can use decimal numbers on most tiles (like 1.5 1.25 etc), is that enough?

Offline

#4 13-02-2014 09:10:54

chrismaliszewski
Contributors
From: Torun, Poland
Registered: 06-05-2013
Posts: 246
Website

Re: Custom tilesize (in px)

Thomas is right. During the night I figured out that equations I gave you are wrong. Margins are calculated wrong because they assume that width and height of all tiles is the same so multiplication of y/x and height/width can be calculated in wrong way.

The solution to this would be adding additional parameter which tells what margin left and top in group for created tile is and this parameter must be required and set by user. After that equations are:
$marginTop = $marginTopOfFile+getMarginTop($group);
$marginLeft = $marginLeftOfFile+getMarginLeft($group);
$tileWidth = $width-$spacing;(?)
$tileHeight = $height-$spacing;(?)

To be honest I wouldn't bother to change so many things for such a small thing.

Cheers.

Offline

#5 13-02-2014 14:55:34

steebchen
Contributors
From: Germany
Registered: 03-05-2013
Posts: 121

Re: Custom tilesize (in px)

Ok, I think I can use decimal numbers, thank you guys smile

Offline

Board footer

Powered by FluxBB