Results 1 to 7 of 7

Thread: How to make grid visible ?

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2005
    Location
    Midwest
    Posts
    15

    How to make grid visible ?

    Trying to make a grid based online game, I would like to be able to see how to see the grid while running test, or to make it togglable.

    I want to be able to see how the tiles for the graphics layout with and without the grid. Possible?

  2. #2
    Frenzied Member
    Join Date
    Oct 2003
    Posts
    1,301

    Re: How to make grid visible ?

    Just draw lines.

  3. #3
    Lively Member
    Join Date
    Oct 2004
    Posts
    91

    Re: How to make grid visible ?

    jeroen79 is right, you need to manually add lines to your program. There is another way though, assuming your images for your grid are bigger than say 5px wide and high, you can make a 'test' tileset where you draw black lines on the images around the border. That would work, and depending on how many images you are using it may be faster. Drawing lines slows rendering time considerably.

  4. #4

    Thread Starter
    New Member
    Join Date
    Feb 2005
    Location
    Midwest
    Posts
    15

    Re: How to make grid visible ?

    Will this be coded or done differently. Sorry. Not understand fully.

  5. #5
    Fanatic Member damasterjo's Avatar
    Join Date
    Nov 2005
    Location
    In front of my Comp DirectX7 EXpert
    Posts
    827

    Re: How to make grid visible ?

    dont do it that way, just draw horizontal lines across the screen every height of the sprite and vertical ones every width of the sprite. It is just that simple
    Software languages known:
    Qbasic - TI-Basic - Liberty Basic - Visual Basic 6
    Software API's known:
    Directx 7 and 8
    Internet languages, in the process of learning:
    HTML - JAVASCRIPT - PHP - CSS - MYSQL - AJAX

  6. #6

    Thread Starter
    New Member
    Join Date
    Feb 2005
    Location
    Midwest
    Posts
    15

    Re: How to make grid visible ?

    I can see drawing lines and importing somehow, but drawing lines by height and width without coding is doable... i will reattempt, but this latest info is c onfusing.

  7. #7
    Junior Member
    Join Date
    Jan 2006
    Posts
    22

    Re: How to make grid visible ?

    well you could do this also....

    Dim wid As Long
    Dim hig As Long
    Dim X As Long
    Dim Y As Long
    Dim SresW As Long
    Dim SresH As Long

    'total width of the area
    wid = Picture1.Width
    hig = Picture1.Height

    'how many squares across
    X = Text1.Text

    'how many squares Down
    Y = Text2.Text

    SresW = wid / X
    SresH = hig / Y

    For i = 1 To X
    Picture1.Line (SresW * i, 0)-(SresW * i, hig)
    Next i

    For a = 1 To Y
    Picture1.Line (0, SresH * a)-(wid, SresH * a)
    Next a

    this will draw the lines for you according to the size of the picturebox and how many boxes you want.

    so you can make 2 textboxes or you can just change them to a specific number.
    Last edited by [email protected]; Jul 12th, 2006 at 04:04 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width