There's a lot of Unicode-Symbols in the upper CodePoint-Ranges, which are suitable for simple Game-Purposes.
- e.g. for Chess-Pieces: https://en.wikipedia.org/wiki/Chess_...2_chess_pieces
- but also for Cards: https://en.wikipedia.org/wiki/Playing_cards_in_Unicode
With proper Unicode-Textoutput-Methods (as e.g. TextOutW, which is used here),
one can use these "complex Shapes in a single Character" instead of Image-Resources.
The whole thing was inspired by this thread: https://www.vbforums.com/showthread....=1#post5569943
(and the questions which followed, which were also about the TileHandling)...
So the Code below shows an "Excel-like" Cell- (or Tile-) addressing,
using a Dictionary behind a cTileArea-Object, to manage each Tile individually.
The addressing-scheme is currently "Bottom-Up" like in Chess (from "a1" to "h8") -
but this can be switched in cTileArea.Init (along with the amount of Tiles), to make it "Top-Down" like in Excel.
An additional cCanvas-Object (bound to a normal VB.PictureBox) provides special Rendering-Support.
Here is, what it produces:
![Name: TileHandling.png
Views: 40
Size: 122.4 KB]()
And here is the Project-Code:
TileHandling.zip
Have fun,
Olaf
- e.g. for Chess-Pieces: https://en.wikipedia.org/wiki/Chess_...2_chess_pieces
- but also for Cards: https://en.wikipedia.org/wiki/Playing_cards_in_Unicode
With proper Unicode-Textoutput-Methods (as e.g. TextOutW, which is used here),
one can use these "complex Shapes in a single Character" instead of Image-Resources.
The whole thing was inspired by this thread: https://www.vbforums.com/showthread....=1#post5569943
(and the questions which followed, which were also about the TileHandling)...
So the Code below shows an "Excel-like" Cell- (or Tile-) addressing,
using a Dictionary behind a cTileArea-Object, to manage each Tile individually.
The addressing-scheme is currently "Bottom-Up" like in Chess (from "a1" to "h8") -
but this can be switched in cTileArea.Init (along with the amount of Tiles), to make it "Top-Down" like in Excel.
An additional cCanvas-Object (bound to a normal VB.PictureBox) provides special Rendering-Support.
Here is, what it produces:
And here is the Project-Code:
TileHandling.zip
Have fun,
Olaf