File: files.rst

package info (click to toggle)
glue 0.13-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 856 kB
  • sloc: python: 1,395; makefile: 117
file content (87 lines) | stat: -rw-r--r-- 3,848 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
Configuration files
==========================

Introduction
------------
``glue`` has around 30 command line options. Remember all of them every time you need to rebuild your sprites could be really annoying. If you are using glue as part of your assets rebuild process and you want consistent executions over time, using configuration files could be a good idea.

The only thing you need to do is create a file named ``sprite.conf`` inside your sprite folder (or project folder if you want to apply this settings to your entire project) and glue will override your command line options using these settings. Project-level and sprite-level configuration files can coexist::

    sprites
        ├── actions
        │   ├── add.png
        │   ├── remove.png
        │   └── sprite.conf
        └── icons
        │   ├── comment.png
        │   ├── new.png
        │   └── rss.png
        └── sprite.conf

If for example you want to change the namespace and the default padding to all your sprites you can add this to your project-level ``sprite.conf``::

    [sprite]
    namespace=my-sprites
    padding=20


If the ``actions`` images needs to be cropped and have a different padding, you can create add the following settings to your new ``actions/sprite.conf`` file::

    [sprite]
    crop=true
    padding=10

If the ``remove.png`` image needs to have ``10px`` margin and ``0px`` padding you can append a new section to your ``actions/sprite.conf`` like the following::

    [remove.png]
    margin=10
    padding=0

This will override any previous setting about ``margin`` or ``padding`` affecting ``remove.png``.

.. note::
    project-level, sprite-level and image-level settings override any environmnet or command-line settings. More information in the `settings section <http://glue.readthedocs.org/en/latest/settings.html>`_

Available configuration
-----------------------

============================ ============== ============== ==============
Configuration File setting   Project-level  Sprite-level   Image-level
============================ ============== ============== ==============
source
output
quiet
watch
project
recursive                    X              X
follow_links                 X              X
force                        X              X
algorithm                    X              X
algorithm_ordering           X              X
css_dir                      X              X
css_namespace                X              X
css_sprite_namespace         X              X
css_url                      X              X
css_cachebuster              X              X
css_cachebuster_filename     X              X
css_separator                X              X
css_template                 X              X
css_pseudo_class_separator   X              X
less_dir                     X              X
scss_dir                     X              X
img_dir                      X              X
generate_image               X              X
png8                         X              X
ratios                       X              X
html_dir                     X              X
cocos2d_dir                  X              X
caat_dir                     X              X
json_dir                     X              X
json_format                  X              X
crop                         X              X              X
padding                      X              X              X
margin                       X              X              X
============================ ============== ============== ==============

.. note::
    You can't enable output formats using configurations files. If for example you add ``less_dir`` to your ``sprite.conf`` this would only override ``less`` output fodler if less is already an enabled output format.