开发者

wp7 xna emulator grid

hi is there a grid feature in the xna so i can locate my textures more easily? d开发者_如何学JAVAo you have other ideas for this problem? thanks


You can just draw your own grid. Just draw a 1 pixel image at every 10th coordinate or something. That should do it for you. There is no built in functionality for this, so you're going to have to do it yourself if you really want it.

Edit: I made it sound simple, but really you're going to want to draw the 1 pixel image in a loop similar to: In your draw() method:

for (int x = 1; x < viewPort.Width; ++x) 
{
    for (int y = 1; y < viewPort.Height; ++y)
    {
        if (x % 10 == 0 || y % 10 == 0) 
        {
            spriteBatch.Draw(texture, new Vector2(x, y), Color.White);
        }
    }
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜