question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Wrong sprite dimensions

See original GitHub issue

When using the retina-sprite mixin, I get the wrong width and height for my sprites.

Let’s say a sprite is supposed to appear 46px wide and high on the page. The retina-sprite mixin will use 92px for the CSS height and width instead, from the dimensions of the retina .png.

Here’s the task I’m using to generate my sprites:

// Manage sprites gulp.task('sprites', function () { var spriteData = gulp.src([ imagePaths.source + "sprites/*.png", imagePaths.source + "sprites-2x/*.png" ]) .pipe(spritesmith({ retinaSrcFilter: imagePaths.source + "sprites-2x/*.png", imgName: 'spritesheet.png', retinaImgName: 'spritesheet-2x.png', cssName: '_sprites.scss' })) .on("error", handleError); var imgStream = spriteData.img .pipe(buffer()) .pipe(imagemin(imageMinConfig.pngQuant)) .pipe(gulp.dest(imagePaths.dist + 'sprites/')); var cssStream = spriteData.css .pipe(gulp.dest('./sass_helpers')); return merge(imgStream, cssStream); });

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jasonevinescommented, May 9, 2017

That’s done the trick. Thanks for your help!

0reactions
twolfsoncommented, May 9, 2017

We have created a test and patch in 6.5.0 to resolve this issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

wrong sprite size - Discuss Scratch
Every time I try to change the size of my sprite it goes to 56% instead of what I want it to do.My...
Read more >
Really confused about sprite sizes - Unity Forum
Hello all! Am trying to create my first game, it will be a platformer 2d game. But i am really confused on what...
Read more >
Am I crazy? How big should video game sprites be? (x-post ...
No, the sprite sheets are usually around 11264x1024, my friend tells me. And the window size is usually going to be around 600x800...
Read more >
Errors regarding sprite resizing · Issue #78 - GitHub
Earlier today, I attempted to change where a sprite reads whatever off of a sprite sheet, including resizing it.
Read more >
Sprite size is not correct - cocos2d-x - Cocos Forums
If design resolution is the size with which you design assets, why does is the size of the sprite incorrect? slackmoehrle March 28,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found