Search Unity

Drawing rectangles / outlines over object faces

Discussion in 'Scripting' started by aukyr, Sep 5, 2011.

  1. aukyr

    aukyr

    Joined:
    Sep 3, 2011
    Posts:
    1
    Hello,

    I'm a long time flash developer, and now learning unity by making a doodle project. It's a turn based strategy game. I managed to print the game map out of blocks and did some camera controls.

    here:
    http://aukyr.com/games/m0ar_soil

    However,
    I could not figured out a way to draw a grid over this map. I know I could just draw the grid over tile blocks, but I don't want the grid line thickness to change when map is zoomed in or out (mouse wheel on my demo)

    If you are coming from flash/as3 like me, I'm looking for a substitute to this:

    mySprite.graphics.lineStyle(1, 0x000000, 1, true);
    mySprite.graphics.drawRect(0, 0, 100, 100);

    Generally I'm asking some advice for doing things like these: (circles, hexs rects on terrains)
    http://dl.dropbox.com/u/27318600/Temp/unityForum/rectOnMapTile.png
    http://media.pcgamer.com/files/2010/06/CIVILIZATION-V-E3-2010-GunshipVinfantry-590x3591.jpg
    http://t2.gstatic.com/images?q=tbn:ANd9GcRc_p_K36i3FcipKRtKDP5eLHPwRLpfvA_42J2S8wEfGB9EVvbQyg
    http://www.cyberstratege.com/magazine/wp-content/uploads/2010/10/civilization-5-header_33.jpg

    Another solution I can think of is to put flat transparent objects containing the grid lines slightly above each tile. But wouldn't this cause glitches, artifacts?

    As I'm building myself a set of solutions lists cheat sheets for unity like I did for flash years ago while learning it, I'll be glad to hear "how you would do" these.

    Thank you.