GithubHelp home page GithubHelp logo

davidtheclark / grunt-spritesmith-hd Goto Github PK

View Code? Open in Web Editor NEW
10.0 10.0 5.0 117 KB

An adaptation of grunt-spritesmith to produce hd-ready sprites

License: Other

CoffeeScript 6.21% CSS 2.46% JavaScript 61.27% HTML 30.06%

grunt-spritesmith-hd's People

Contributors

benib avatar davidtheclark avatar hparra avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

grunt-spritesmith-hd's Issues

Allow for external images

Change line 171 to:
coordinate.image = imgUrl + '/' + baseSpritesheet;

line 183 to:
"hdSpritesheetPath": imgUrl + '/' + hdSpritesheetName

Otherwise node's path will remove the double "//"

Getting error "Fatal error: Property 'log' of object #<Object> is not a function"

Hi, each time I run the task with the hd option not specified I get this error. If hd is set to false I don't get the error.

Here's the verbose output from grunt:

Running "spriteHD" task

Running "spriteHD:mainPage" (spriteHD) task
Verifying property spriteHD.mainPage exists in config...OK
Files: Source/site/templates/img/tile/st-logo-large.png, Source/site/templates/img/tile/st-    logo-small.png
Options: engine="auto", destImg="Source/site/templates/img/sprites", destCSS="Source/site/templates/css/sass/sprites", imgUrl="/site/templates/img/sprites"
Creating temporary hd assets ...
Reading Source/site/templates/img/tile/st-logo-large.png...OK
Writing tempAssets/hd-main-assets/hd-st-logo-large.png...OK
Reading Source/site/templates/img/tile/st-logo-small.png...OK
Writing tempAssets/hd-main-assets/hd-st-logo-small.png...OK
Creating temporary ld assets ...
Fatal error: Property 'log' of object #<Object> is not a function

If I then run the task again, I get:

An existing directory is getting in the way of spritesmithHD creating a temporary LD asset directory at 'tempAssets/ld-main-assets'.

mustache template fix

It would be nice if the mustache template could be customized (i.e. some config option?), a little fix that I suggest (if this does not break anything) is to change the "${{name}}" variable build like this:

${{name}}: ${{name}}-x ${{name}}-y ${{name}}-offset-x ${{name}}-offset-y ${{name}}-width ${{name}}-height ${{name}}-total-width ${{name}}-total-height ${{name}}-image ${{name}}-hd;

This can be useful if some adjustments (such as custom positions or width, etc.) are required before CSS sprite is built.

Thanks for your job ;)

My bests,

-- Valerio

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.