English 中文(简体)
在制作图案时在图像前投入前侧斜线的指南针
原标题:Compass throwing in forward slash in front of images when making sprites

我正在使用指南针创建图例。 正在创建图例, 但 css 输出指向图像目录的错误位置 。

输出为 :

.menu-sprite, .menu-about, .menu-art, .menu-drum, .menu-links, 
.menu-music, .menu-science, .menu-writing {
    background: url( /images/menu-sb7e36b009c.png ) no-repeat;
}

但我希望它是:

.menu-sprite, .menu-about, .menu-art, .menu-drum, .menu-links, 
.menu-music, .menu-science, .menu-writing {
    background: url( images/menu-sb7e36b009c.png ) no-repeat;
}

这就是我的密友,

http_path = "/"
css_dir = "."
sass_dir = "sass"
images_dir = "images"
javascripts_dir = "js"

这就是我如何在我的Scs文件中调用图例:

@import "compass/utilities/sprites/base";
@import "menu/*.png";
@include all-menu-sprites;

我做错什么了?我怎么能在图像面前移除第一刀呢?

谢谢你的帮助

问题回答

默认情况下,指南针对所有资产都使用绝对路径。

要改变此行为, 请在配置 rb 中添加此行 :

relative_assets = true

否则,您也可以更改 http_path 选项, 以指向您的部署服务器上的项目站点 。





相关问题
Turning a DirectX sprite Solid White

I have a sprite of my main character. I normally draw it with a color modulus of ARGB(255,255,255,255). However, I would like my sprite to be drawn more white. I can make the sprite be drawn any ...

Glitch when moving camera in OpenGL

I am writing a tile-based game engine for the iPhone and it works in general apart from the following glitch. Basically, the camera will always keep the player in the centre of the screen, and it ...

How to load a specific patch/rectangle from an image?

We have an application that show a large image file (satellite image) from local network resource. To speed up the image rendering, we divide the image to smaller patches (e.g. 6x6 cm) and the app ...

How do I go about implementing sprite masking?

Using DirectX I m rendering textured polygons (orthographically) so they act as HUD sprites. Now I m not sure how would I go about implementing sprite masking in this sytem? So basically say I have a ...

Is it possible to use a pixel shader inside a sprite?

Is it possible to use a pixel shader inside a sprite? I have create a simple pixel shader, that just writes red color, for testing. I have surrounded my Sprite.DrawImage(tex,...) call by the effect....

热门标签