Last active
August 29, 2015 14:01
-
-
Save vitto/ca08bf48389fb5618874 to your computer and use it in GitHub Desktop.
Frontsize - How to create a retina ready bitmap sprite
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is how to create a sprite which is retina ready | |
<div class="sprite-retina-ready foo"></div> | |
<div class="sprite-retina-ready bar"></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.sprite-retina-ready { | |
@spriteWidth: 32px; | |
@spriteHeight: @spriteWidth; | |
@imageWidth: 64px; | |
@imageHeight: 32px; | |
.spriteRetina("sprite-1x.png", "sprite-2x.png", @spriteWidth, @spriteHeight, @imageWidth, @imageHeight); | |
.setSprite(foo, 0, 0, @spriteWidth); | |
.setSprite(bar, 1, 0, @spriteWidth); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment