Savio Dimatteo > CSS-SpriteMaker-0.07 > CSS::SpriteMaker::Layout::FixedDimension

Download:
CSS-SpriteMaker-0.07.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  1
View/Report Bugs
Module Version: 0.01   Source   Latest Release: CSS-SpriteMaker-0.15

NAME ^

CSS::SpriteMaker::Layout::FixedDimension

    my $FixedDimensionLayout = CSS::SpriteMaker::Layout::FixedDimension->new(
        # example $rh_item_info input structure
        {
            "1" => {
                width => 128,
                height => 128,
            },
            ...
        },
        # max 10 items on the same row,
        { 
            dimension => 'horizontal',
            n => 10
        },
    );

Layout maximum n items on a row.

Items are chosen at random.

Input $rh_item_info structure must contain the following keys for this layout to produce a result:

- width : the width in pixels of the image;

- height : the height in pixels of the image;

The following input parameters must be specified:

- n : number of maximum items to place on the same row

The following input parameters are optional:

- dimension: can be 'horizontal' (default) or 'vertical'.

VERSION ^

Version 0.01

new

Instantiates the layout:

    my $FixedDimensionLayout = CSS::SpriteMaker::Layout::FixedDimension->new(
        $rh_item_info,
        {   dimension => 'vertical'  # 'horizontal' is the default
            n => 10                  # compulsory!
        }
    );

_layout_items

syntax highlighting: