Jump to content

  • Log In with Google      Sign In   
  • Create Account

hex grids


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
10 replies to this topic

#1 phil67rpg   Members   -  Reputation: 767

Like
0Likes
Like

Posted 21 April 2005 - 04:40 PM

I want to draw a hex grid map using windows 32 api

Sponsor:

#2 chad_420   Members   -  Reputation: 290

Like
0Likes
Like

Posted 21 April 2005 - 04:41 PM

I want to understand what you want.

#3 phil67rpg   Members   -  Reputation: 767

Like
0Likes
Like

Posted 21 April 2005 - 04:45 PM

I am trying to design a game like panzer general and I need a hex background to start with and I want to use windows graphics to draw it

#4 chad_420   Members   -  Reputation: 290

Like
0Likes
Like

Posted 21 April 2005 - 04:54 PM

Ok.

#5 Telastyn   Crossbones+   -  Reputation: 3726

Like
0Likes
Like

Posted 21 April 2005 - 04:57 PM

Just a quick hint.

For beginners, it's often easier to draw a square grid map where the squares happen to have 6 neighbors [like the old Imperialism games if you've played them]

#6 SoulSkorpion   Members   -  Reputation: 238

Like
0Likes
Like

Posted 21 April 2005 - 06:33 PM

If you're looking for people to write your code for you then you've come to the wrong place. What exactly is it you want help with?
-------------"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."- Charles Babbage (1791-1871)

#7 MrP   Members   -  Reputation: 565

Like
0Likes
Like

Posted 21 April 2005 - 10:09 PM

Not sure if this will be useful, but Amit's Game Programming Information site has some articles on hex grids, and if you look in his games section you can download the source code for a game he wrote that uses a hex grid.

There is also this article written by TANSTAAFL which looks like it could be what you need.

Give us more details and we'll be able to help you more.

#8 Will F   Members   -  Reputation: 1069

Like
0Likes
Like

Posted 22 April 2005 - 08:15 AM

Here's another link with a little bit more info on hexagonal and isometric tiles.


#9 b2b3   Members   -  Reputation: 602

Like
0Likes
Like

Posted 22 April 2005 - 09:21 AM

Are you in any way limited to using only GDI or can you use GDI+? If you are not planning support for Windows 2000 or older, I suggest using GDI+. It's object oriented and very easy to set up and work with (and has tons of features).
You can find more info about it here.
More info about GDI is here.

#10 phil67rpg   Members   -  Reputation: 767

Like
0Likes
Like

Posted 22 April 2005 - 03:36 PM

well I drew a square grid using GDI+ and C# and want to convert the grid into a hex grid ?

#11 b2b3   Members   -  Reputation: 602

Like
0Likes
Like

Posted 22 April 2005 - 11:33 PM

The simplest method is to create small tile and then copy it all over the image. For hexagonal grid you can use tile like this:

#_____#_____#
#_____#_____#
#_____#_____#
_#___#_#___#_
__#_#___#_#__
___#_____#___
___#_____#___
___#_____#___
__#_#___#_#__
_#___#_#___#_
#_____#_____#

Then just tile this image and you will get hexagonal grid.
You can create Bitmap which will hold your tile (this image you can load from file) and then use Graphics::DrawCachedBitmap to draw tile bitmap multiple times.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS