2017 © Pedro Peláez
 

library sprite-bundle

Generate sprites with PHP and twig templates

image

nfq-alpha/sprite-bundle

Generate sprites with PHP and twig templates

  • Monday, September 15, 2014
  • by nfq-alpha
  • Repository
  • 0 Watchers
  • 1 Stars
  • 22,530 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 2 Open issues
  • 5 Versions
  • 8 % Grown

The README.md

Nfq Sprite Generator Bundle

Generate sprite images and stylesheets with plain PHP and GD2 (no 3rd party dependencies), (*1)

Installation

Dependancies

PHP extension GD2, (*2)

Get the bundle

Add this in your composer.json, (*3)

{
    "require": {
        "nfq-alpha/sprite-bundle": "dev-master@dev"
    }
}

and then run, (*4)

php composer.phar update

Add the classes to your Kernel

new SpriteGenerator\SpriteGeneratorBundle(),

Configuration

You have to configure your sprites by adding lines to config.yml:, (*5)

sprite_generator:
    sprites:
        spritename:
            inDir: %kernel.root_dir%/../src/Resources/public/img/sprites/
            outImage: %kernel.root_dir%/../src/Resources/public/img/sprite2.png
            outCss: %kernel.root_dir%/../src/Resources/public/scss/_sprites2.scss
            relativeImagePath: ../bundles/img/
            padding: 5
            spriteClass: sprite
            cssFormat: sass
            imagePositioning: one-column
            imageGenerator: gd2
        another_spritename:
            inDir: %kernel.root_dir%/../src/Resources/public/img/sprites/
            outImage: %kernel.root_dir%/../src/Resources/public/img/sprite2.png
            outCss: %kernel.root_dir%/../src/Resources/public/scss/_sprites2.scss
            relativeImagePath: ../bundles/img/
            padding: 5
            spriteClass: sprite_another
            cssFormat: sass
            imagePositioning: one-column
            imageGenerator: gd2

Generate sprites

Generate all your sprites :, (*6)

$ php app/console nfq:sprite:generate

Generate one sprite :, (*7)

$ php app/console nfq:sprite:generate spritename

The Versions

15/09 2014

dev-master

9999999-dev

Generate sprites with PHP and twig templates

  Sources   Download

MIT

The Requires

 

by Kazimieras Butkus

sprite

15/09 2014

1.0.2

1.0.2.0

Generate sprites with PHP and twig templates

  Sources   Download

MIT

The Requires

 

by Kazimieras Butkus

sprite

15/09 2014

dev-develop

dev-develop

Generate sprites with PHP and twig templates

  Sources   Download

MIT

The Requires

 

by Kazimieras Butkus

sprite

15/09 2014

1.0.1

1.0.1.0

Generate sprites with PHP and twig templates

  Sources   Download

MIT

The Requires

 

by Kazimieras Butkus

sprite

12/09 2014

1.0.0

1.0.0.0

Generate sprites with PHP and twig templates

  Sources   Download

MIT

The Requires

 

by Kazimieras Butkus

sprite